[rancid] Checking for root

Matthew Walster matthew at walster.org
Thu Jun 6 14:45:09 UTC 2013


More often than not, people are coming to me with RANCID issues that have
arisen because someone has been impatient and decided to run rancid-run
manually rather than letting the next run initiate manually.

The only problem with that is that they tend to run it as "root" rather
than the rancid user.

Would it be worth putting a check in so that rancid-run script won't run
unless it's as a non-privileged user (or even better, build it into the
automake run to discover the intended final user).

Simple code sample:

if [[ $EUID -eq 0 && $force -ne 1 ]]
then
        echo "Run this as the RANCID user!"
        exit 1
fi

There's a "force" option there, just in case you really did run it as root,
which seems like bad practice to me...

Just a thought!

Matthew Walster
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20130606/a2a6e9a7/attachment.html>


More information about the Rancid-discuss mailing list