LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 08-24-2020, 07:47 PM   #1
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 878

Rep: Reputation: 120Reputation: 120
run rc.nginx from rc.local


@Exaga
I figured I'd find you here .... I note your slackdoc nginx on Slackware ARM. I have been using nginx as the server on our lan for at least 5 years if not longer and I have never figured out why I have to start nginx from /etc/rc.d/rc.local.

Is there a reason for this? I'ts been a while but it seems to me that I didn't have to run /etc/rc.d/rc.httpd from rc.local.
 
Old 08-25-2020, 02:34 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
I have been using nginx as the server on our lan for at least 5 years if not longer and I have never figured out why I have to start nginx from /etc/rc.d/rc.local.

Is there a reason for this? I'ts been a while but it seems to me that I didn't have to run /etc/rc.d/rc.httpd from rc.local.
FYI starting httpd is done automatically if /etc/rc.d/rc.httpd exists (and it's executable), because it's called from inside /etc/rc.d/rc.M:
Code:
# Start Apache web server:
if [ -x /etc/rc.d/rc.httpd ]; then
  /etc/rc.d/rc.httpd start
fi
You can add a similar if statement in /etc/rc.d/rc.M for nginx, so it'll start automatically if /etc/rc.d/rc.nginx exists and it's executable

Regards
 
Old 08-25-2020, 05:22 AM   #3
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 878

Original Poster
Rep: Reputation: 120Reputation: 120
Code:
# Start nginx web server
if [ -x /etc/rc.d/rc.nginx ] then
    /etc/rc.d/rc.nginx start
fi
Perhaps I'm missing something here, The above statement in /etc/rc.d/rc.M will not start the nginx server, however, the following line in /etc/rc.d/rc.local will
Code:
# Start the nginx server
/etc/rc.d/rc.nginx start
I'll leave it at that. I've been fiddling around with trying to get something else to run at boot with either its command in rc.local or an rc script for a couple of hours with no joy yet ... nginx from rc.local is good ....
 
Old 08-25-2020, 05:56 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by justwantin View Post
Code:
# Start nginx web server
if [ -x /etc/rc.d/rc.nginx ] then
    /etc/rc.d/rc.nginx start
fi
Perhaps I'm missing something here, The above statement in /etc/rc.d/rc.M will not start the nginx server, however, the following line in /etc/rc.d/rc.local will
Code:
# Start the nginx server
/etc/rc.d/rc.nginx start
I'll leave it at that. I've been fiddling around with trying to get something else to run at boot with either its command in rc.local or an rc script for a couple of hours with no joy yet ... nginx from rc.local is good ....
You miss the semicolon after the closing square bracket, so I guess that's why it's not starting on boot from rc.M
Code:
if [ -x /etc/rc.d/rc.nginx ]; then
    /etc/rc.d/rc.nginx start
fi
 
Old 08-25-2020, 07:07 AM   #5
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 878

Original Poster
Rep: Reputation: 120Reputation: 120
Yes ... that'll do it ... thank you I've been sitting here for too long.
Code:
rick@bpro10:~$ ps -A | grep nginx
  893 ?        00:00:00 nginx
  895 ?        00:00:00 nginx
Cheers
 
Old 08-25-2020, 09:25 AM   #6
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by justwantin View Post
@Exaga
I figured I'd find you here .... I note your slackdoc nginx on Slackware ARM. I have been using nginx as the server on our lan for at least 5 years if not longer and I have never figured out why I have to start nginx from /etc/rc.d/rc.local.

Is there a reason for this? I'ts been a while but it seems to me that I didn't have to run /etc/rc.d/rc.httpd from rc.local.
Hi justwantin,

For bona fide Slackware rc.scripts just making them executable will ensure they run automatically at boot time. Although this is not the same for nginx and other 'non-Slackware' scripts. They need starting appropriately. Adding a line to /etc/rc.d/rc.local is the easiest thing to do in this instance. For times when it is better to have the script(s) started at an earlier point in the boot process you could modify one of the main [rc.M, rc.S, etc.] init scripts. A line in /etc/rc.d/rc.local for such scripts is easier to manage for me.

IIRC I also needed FastCGI to start before nginx. So that's why I put it in that specific order in the /etc/rc.d/rc.local file.
 
  


Reply

Tags
nginx, rc.nginx, slackware, slackwarearm



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nginx/1.4.1 '/etc/nginx/sites-available/default' missing Jalalabee Linux - Newbie 0 06-05-2013 07:44 AM
nginx + php-fpm and nginx modules fantasygoat Linux - Server 0 06-09-2011 12:21 PM
LXer: Nginx+Varnish compared to Nginx LXer Syndicated Linux News 0 04-27-2011 02:30 PM
Nginx experts help me-problem when using Nginx php-fpm !!! HuMan-BiEnG Linux - Server 2 04-17-2011 02:30 PM
NGINX with PHP-FPM vis NGINX with Spawn-FCGI WhisperiN Linux - Server 1 03-15-2011 06:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 12:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration