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>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 14 July 2005 07:17, Achilleus Mantzios wrote: > O Bryan Maynard =DD=E3=F1=E1=F8=E5 =F3=F4=E9=F2 Jul 13, 2005 : >=20 > > 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=3Diang z_users_file=3D/usr/local/etc/z_users if [ -r "${z_users_file}" ] then users=3D$(cat ${z_users_file}) fi set -x echo User Startup: for user in $users _ do [ "$user" =3D _ ] && break eval dir=3D~${user} rcdir=3D${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 =2D-------------------------------8< =2D-=20 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507141025.51464.iang>