Date: Sat, 30 Jan 2016 20:35:25 +0100 From: Polytropon <freebsd@edvax.de> To: roberthuff@rcn.com Cc: freebsd-questions@freebsd.org Subject: Re: "epilogue" script? Message-ID: <20160130203525.261a0619.freebsd@edvax.de> In-Reply-To: <22188.61368.149775.620206@jerusalem.litteratus.org> References: <17145.128.135.52.6.1454106907.squirrel@cosmo.uchicago.edu> <20160130115955.ce9409ad.freebsd@edvax.de> <22188.61368.149775.620206@jerusalem.litteratus.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 30 Jan 2016 12:15:36 -0500, roberthuff@rcn.com wrote: > > Polytropon writes: > > > b) rc.local and rc.shutdown.local > > > > Those files, located in /etc, are "real" shell scripts that will > > be executed "quite late", but not at the lastest possible > > point. Here is an example: > > > > Creating and/or trimming log files. > > Starting syslogd. > > No core dumps found. > > Additional ABI support: linux. > > Starting named. > > Clearing /tmp (X related). > > Starting local daemons: activity. <--- /etc/rc.local runnung now! > > Starting ntpd. > > Starting dhcpd. > > Starting cupsd. > > Configuring syscons: keymap keyrate font8x16 font8x14 font8x8. > > Starting sshd. > > Starting cron. > > Starting inetd. > > > > As you can see, there are other services started _after_ rc.local > > has been run. This might cause a problem for you when you need > > those services running. > > Since this indicates when things are started, as opposed to > when they take effect, it implies dropping (e.g.) "sleep 20" either > at the beginning of rc.local or a carefully chosen points therein > might cause stuff to happen when desired. > Crude ... but often effective. Hey, it's not _that_ bad - I did worse! For a client worksation with a crappy inkpee printer that often tended to stop working, I wrote a script that forcedly emptied the printer queue and re-enabled + re-accepted the printer (lprm, cupsenable, cupsaccept), so whenever the system was booted, the printer would be set to "normal". But as you can see: This did not work, as CUPS was started _after_ rc.local. Well... I decided to put those commands into the user's login shell script, but that was not executed - as he used Gnome + gdm, and _no_ initialization scripts were being honored (no .xinitrc, .xsession, .login etc.). So I ended up adding a Gnome custom "startup app" to that user's desktop session configuration. When I'm near that particular system again, I'll do the "sleep trick" with rc.local. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160130203525.261a0619.freebsd>