Date: Thu, 14 Jul 2005 10:25:48 +0100 From: Ian Grigg <iang@systemics.com> To: freebsd-java@freebsd.org Cc: Bryan Maynard <bryan.maynard@reallm.com> Subject: Re: Tomcat locked down Message-ID: <200507141025.51464.iang@systemics.com> In-Reply-To: <Pine.LNX.4.44.0507140909140.31456-100000@matrix.gatewaynet.com> References: <Pine.LNX.4.44.0507140909140.31456-100000@matrix.gatewaynet.com>
index | next in thread | previous in thread | raw e-mail
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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507141025.51464.iang>
