"epilogue" script?

Polytropon freebsd at edvax.de
Sat Jan 30 19:35:30 UTC 2016

On Sat, 30 Jan 2016 12:15:36 -0500, roberthuff at 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. :-)

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list