Tomcat locked down

Ian Grigg iang at systemics.com
Thu Jul 14 09:27:37 GMT 2005


On Thursday 14 July 2005 07:17, Achilleus Mantzios wrote:
> O Bryan Maynard έγραψε στις Jul 13, 2005 :
> 
> > I know this is a simple thing. . . ;-)

> /etc/rc.d, /usr/local/etc/rc.d/ tasks are not to be stopped and started
> by anyone. Only root can do this.

I usually install the below
script in /usr/local/etc/rc.d as name z_users.sh
to give user apps a shot under their own Id.

(Although this answers the problem of how to
run non-root apps on startup, not how to run
root apps as a user.)

iang

8<-----------------------------

#!/usr/local/bin/bash

users=iang
z_users_file=/usr/local/etc/z_users
if [ -r "${z_users_file}" ]
then
        users=$(cat ${z_users_file})
fi

set -x
echo User Startup:
for user in $users _
do
        [ "$user" = _ ] && break

        eval dir=~${user}
        rcdir=${dir}/rc.d
        if [ -d "${rcdir}" ]
        then
                cd ${dir}
                echo -n ${name}
                for script in ${rcdir}/*.sh
                do
                        # watch out - there are two different su(1).
                        [ -x ${script} ] &&
                                /usr/bin/su ${user} -c "${script} start" \
                                2>&1 0</dev/null |
                                mail -s "rebooted ${script}" ${user} &
                done
        fi
done

--------------------------------8<

-- 
Advances in Financial Cryptography, Issue 2:
   https://www.financialcryptography.com/mt/archives/000498.html
Mark Stiegler, An Introduction to Petname Systems
Nick Szabo, Scarce Objects
Ian Grigg, Triple Entry Accounting


More information about the freebsd-java mailing list