Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 285271 Details for
Bug 381451
app-misc/screen - add an init script to run multiple screen instances as a system service
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
/etc/init.d/screen
screen (text/plain), 2.00 KB, created by
Ilya Dmitrichenko
on 2011-09-01 15:45:28 UTC
(
hide
)
Description:
/etc/init.d/screen
Filename:
MIME Type:
Creator:
Ilya Dmitrichenko
Created:
2011-09-01 15:45:28 UTC
Size:
2.00 KB
patch
obsolete
>#!/sbin/runscript ># Copyright 1999-2011 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 > ># http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4 > >depend() { > use net debug >} > >start() { > > for SCREENRC in /etc/screen.d/* ; do > > SESSION="$(basename $SCREENRC)" > > ## I don't think there may be a security issue, > ## provided that users will not be have write > ## permission in /etc/screen.d/ and if anyone > ## gained access to mod the session file, they > ## are in already anyhow! > BELONGS="$(stat $SCREENRC --printf=%U)" > > MYSHELL="$(getent passwd $BELONGS | cut -d: -f7)" > > > COMMAND="/usr/bin/screen -- -U -D -m -c ${SCREENRC} -S ${SESSION} -t ${SESSION}" > > ## Why on earth would one write this ??? > #HOMEDIR="$(getent passwd $BELONGS | cut -d: -f6)" > > ebegin "Starting screen session ${SESSION} for ${BELONGS}" > > PIDFILE="/var/run/screen.${BELONGS}.${SESSION}.pid" > > start-stop-daemon \ > --env TERM="rxvt" \ > --env HOME="~${BELONGS}" \ > --env SCREEN_SESSION=${SESSION} \ > --user $BELONGS \ > --chdir "~${BELONGS}" \ > --make-pidfile \ > --background \ > --pidfile=${PIDFILE} \ > --exec ${COMMAND} > eend $? > done > > #screen -li || /bin/true >} > >stop() { > > ## Perhaps we should determin this by pidfiles ... > ## but this way is not bad either! > for SCREENRC in /etc/screen.d/* ; do > > SESSION="$(basename $SCREENRC)" > BELONGS="$(stat $SCREENRC --printf=%U)" > > PIDFILE="/var/run/screen.${BELONGS}.${SESSION}.pid" > PROCESS="$(cat ${PIDFILE})" > > if [ -e /proc/${PROCESS}/status ]; then > > grep -i "Name:" /proc/${PROCESS}/status | grep -iq "screen" || continue > > ebegin "Stopping screen session ${SESSION} for ${BELONGS} (PID: ${PROCESS})" > > ## There other things we can try here ... > ## perhaps add /etc/screen.d/$SESSION.stop > > ## It will CERTAINly kill the righ screen! > CERTAIN="${PROCESS}.${SESSION}" > env TERM="urxvt" \ > start-stop-daemon \ > --user ${BELONGS} \ > --exec /usr/bin/screen -- -S $CERTAIN -X quit > eend $? > > fi > > rm -f $PIDFILE > > done >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 381451
:
285271
|
285849