/etc/rc.local

by Juliet Kemp

This for the "how the hell have I done this job this long & not known this already?" files.

Debian has a file called /etc/rc.local which runs at the end of all the multi-user boot levels, and which you can therefore put stuff in. I've had trouble with autofs not starting properly on certain machines (there seems to be a correlation with SCSI or SATA rather than IDE drives, although I do not know why this should be), and putting the line

/etc/init.d/autofs restart
in /etc/rc.local, whilst arguably a hack, does the trick just fine.

Especially baffled that I didn't know of this file because I've had to do stuff like this in the past, and have horribly misused /etc/init.d/rmnologin instead.

In totally unconnected, and not even slightly tech-related news: a bunch of my cycling friends are riding 1200km in 90hrs in France this week, for fun. (I was hoping to go as well but didn't qualify - although given the vile weather they've had this might be for the best.) They're all doing fantastically well, especially given the awful conditions, & I've been following their progress all week with much excitement (one person has finished already, in 60hrs!). Finish deadline is 4pm French time tomorrow. Allez allez!


5 Comments

Prakash
2007-08-24 11:04:35
dont u know ppl uses upstart as replacement to sysVinit :?
do u believe the same /etc/rc.local works still?
even for a passwd reset i have to append rw init=/bin/bash to get a # prompt rather than a "1" or "single".just for an update :)
Caitlyn Martin
2007-08-29 12:51:10
It's not just Debian-based system. That file exists on all Linux systems and most UNIX flavors as well. Slackware and it's derivative distros have it in a slightly different place: /etc/rc.d/rc.local but the functionality is the same.


There are so many ways a sys admin can do things in Linux that I'm not surprised you did hacks like this another way. I'm always learning new ways of doing things and I've been doing *nix professionally since '95. I don't think any sys admin, no matter how brilliant, knows every possible system configuration file or approach to tackling a problem.


Good luck to your friends in France.

Art Edwards
2007-11-07 21:37:38
So, I am trying to follow directions for running two apt-cacher's by starting one in rc.local. I'm guessing that I simply stuff the same script that is in /etc/init.d into this unassuming little file. However, the README.debian requires command lines for the two separate instances of the apt-cacher daemon. Where do they go?
tony Arch
2008-01-04 07:35:18
thankyouthankyouthankyouthankyou


i have been searching for weeks to find out how to get my wireless card to boot up using "proper" Mepis programming.... NONE have worked and believe me i tried them ALL


some guy on another forum wrote a working 5 line script... which ive been running by hand until now.... everytime i turn the machine on just to activate wifi.. longwinded workaround.. not what i want from a system


i had no idea you could stick it in the RC.LOCAL.. i just done it.... its worked perfectly... so much for the Knetworkmanager and WICD... "useless"


Mepis dont tell you this as far as i can find out


i am so chuffed i looked in here (ok: if your a Nix progammer, i must sound like a dork.....
Ive been a "newbie" to computers since college days in 1967.. using PDP8's... and all sorts since then..... STILL LEARNING...)

James Wilentz
2008-07-12 21:37:38
Can you write a script to run at logoff or shutdown that unmounts a fused network share that would execute the command:


fusermount -u Network


before logoff or shutdown?


Cycling not in France (though I wish I were) but 18 mi 3x a week in Central Park at ~19mph and trying to get to 20.


Jim