Re: Tomcat locked down

[ Available lists | Index of freebsd-java | Month of Jul 2005 | Week of 14 Jul 2005 | Raw email | View thread | Wrap long lines | Reply ]
From
Ian Grigg <iang@systemics.com>
Date
14 Jul 2005 09:27:37
Subject
Re: Tomcat locked down
Message-ID
200507141025.51464.iang@systemics.com

In reply to
References to

[ Hide this part ]
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


Elapsed time: 0.130 seconds