Slackware - ARM This forum is for the discussion of Slackware ARM. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-24-2020, 07:47 PM
|
#1
|
Member
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 889
Rep: 
|
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.
|
|
|
08-25-2020, 02:34 AM
|
#2
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,221
|
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
|
|
|
08-25-2020, 05:22 AM
|
#3
|
Member
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 889
Original Poster
Rep: 
|
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 ....
|
|
|
08-25-2020, 05:56 AM
|
#4
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,221
|
Quote:
Originally Posted by justwantin
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
|
|
|
08-25-2020, 07:07 AM
|
#5
|
Member
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 889
Original Poster
Rep: 
|
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
|
|
|
08-25-2020, 09:25 AM
|
#6
|
SARPi Maintainer
Registered: Nov 2012
Distribution: Slackware ARM, AArch64
Posts: 1,069
|
Quote:
Originally Posted by justwantin
@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.
|
|
|
01-11-2025, 06:35 PM
|
#7
|
LQ Newbie
Registered: Jan 2025
Distribution: Slackware
Posts: 22
Rep:
|
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
|
|
|
01-11-2025, 10:53 PM
|
#8
|
Member
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 889
Original Poster
Rep: 
|
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.
|
01-12-2025, 01:39 AM
|
#9
|
Senior Member
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 1,418
|
Quote:
Originally Posted by justwantin
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
|
|
|
01-12-2025, 03:08 AM
|
#10
|
Member
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 889
Original Poster
Rep: 
|
@ henka .... you take all the fun out of humor
|
|
|
01-12-2025, 09:34 AM
|
#11
|
LQ Newbie
Registered: Jan 2025
Distribution: Slackware
Posts: 22
Rep:
|
Quote:
Originally Posted by justwantin
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!
|
|
|
All times are GMT -5. The time now is 08:16 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|