LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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: 889

Rep: Reputation: 123Reputation: 123
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,221
Blog Entries: 1

Rep: Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075
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: 889

Original Poster
Rep: Reputation: 123Reputation: 123
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,221
Blog Entries: 1

Rep: Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075Reputation: 2075
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: 889

Original Poster
Rep: Reputation: 123Reputation: 123
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 ARM, AArch64
Posts: 1,069

Rep: Reputation: 687Reputation: 687Reputation: 687Reputation: 687Reputation: 687Reputation: 687
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.
 
Old 01-11-2025, 06:35 PM   #7
Pint
LQ Newbie
 
Registered: Jan 2025
Distribution: Slackware
Posts: 22

Rep: Reputation: 6
I'm new to Slackware. After >20years I decided to quit debian... Just want to contribute.

I decided to resurrect this thread because I find the easiest way for me to start the minidlna server automatically after boot is by incluiding it into

/etc/rc.d/rc.local

Adding the last line.
# Start minidlna
/etc/rc.d/rc.minidlna start



Code:
#!/bin/bash
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.
# Start minidlna
/etc/rc.d/rc.minidlna start
 
Old 01-11-2025, 10:53 PM   #8
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 889

Original Poster
Rep: Reputation: 123Reputation: 123
Always warms my heart to see to see a new Slacker emerge from the shadows ... Welcome!! ... rc.local is a handy place indeed ... Patrick probably invented it but was too modest to admit it ;<)
 
1 members found this post helpful.
Old 01-12-2025, 01:39 AM   #9
henca
Senior Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 1,418

Rep: Reputation: 957Reputation: 957Reputation: 957Reputation: 957Reputation: 957Reputation: 957Reputation: 957Reputation: 957
Quote:
Originally Posted by justwantin View Post
rc.local is a handy place indeed ... Patrick probably invented it but was too modest to admit it ;<)
It is very nice that Patrick has decided to keep the good old rc.local, but he can probably not claim to have invented it. The BSD startup scripts of old SunOS 4.1 (which predates Sun Solaris with SystemV startup scripts) and also predates Slackware also had an rc.local for custom stuff. Back then in SunOS, that file lived as /etc/rc.local, if I remember right there was no rc.d directory on SunOS.

There is a manual from 1990 describing SunOS 4.1 at http://www.bitsavers.org/pdf/sun/sun...ual_199003.pdf and that manual mentions /etc/rc.local.

regards Henrik
 
Old 01-12-2025, 03:08 AM   #10
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 889

Original Poster
Rep: Reputation: 123Reputation: 123
Angry

@ henka .... you take all the fun out of humor
 
Old 01-12-2025, 09:34 AM   #11
Pint
LQ Newbie
 
Registered: Jan 2025
Distribution: Slackware
Posts: 22

Rep: Reputation: 6
Quote:
Originally Posted by justwantin View Post
Always warms my heart to see to see a new Slacker emerge from the shadows ... Welcome!! ... rc.local is a handy place indeed ... Patrick probably invented it but was too modest to admit it ;<)
I posted that here by mistake.
But I'm glad I did and meeting nice people like you.
Thanks man!
 
  


Reply

Tags
nginx, rc.nginx, slackware, slackwarearm


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 08:16 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