Changeset 652
- Timestamp:
- Oct 13, 2007 10:07:41 AM (6 years ago)
- Location:
- trunk/cereal/fs/usr
- Files:
-
- 3 edited
-
sbin/cereal-admin (modified) (4 diffs)
-
share/cereal/common (modified) (2 diffs)
-
share/man/man8/cereal-admin.8 (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/cereal/fs/usr/sbin/cereal-admin
r651 r652 106 106 # start_check 107 107 start_check() { 108 ch pst -u "$USER:$GROUP" bash -c "test -r $TTY && test -w$TTY"108 check_tty_rw "$USER" "$GROUP" "$TTY" 109 109 } 110 110 export -f start_check … … 134 134 elif is_linked "$SESSION" ; then 135 135 error "Session '$SESSION' is already running." 1 136 elif [ ! -w "$SERVICEDIR" ] ; then 137 error "You do not have permission to start session '$SESSION'." 2 136 138 elif ! chpst -e "$SESSIONDIR/$SESSION/env/" sh -c start_check ; then 137 error "Session '$SESSION' not properly configured , or you do not have permission to start session." 2139 error "Session '$SESSION' not properly configured." 2 138 140 else 139 141 if start_session "$SESSION" ; then … … 171 173 elif ! is_linked "$SESSION" ; then 172 174 error "Session '$SESSION' not linked." 1 175 elif ! is_controllable "$SESSION" ; then 176 error "You do not have permission to stop session '$SESSION'." 2 173 177 else 174 178 if stop_session "$SESSION" ; then … … 206 210 if ! is_session "$SESSION" ; then 207 211 echo "Session '$SESSION' not found." 208 continue209 212 elif ! is_linked "$SESSION" ; then 210 213 start "$SESSION" 214 elif ! is_controllable "$SESSION" ; then 215 error "You do not have permission to restart session '$SESSION'." 2 211 216 else 212 217 if restart_session "$SESSION" ; then -
trunk/cereal/fs/usr/share/cereal/common
r651 r652 104 104 export -f is_running 105 105 106 # check if user can control session 107 # is_controllable SESSION 108 is_controllable() { 109 sv status "$SERVICE.$1" > /dev/null 110 } 111 export -f is_controllable 112 106 113 # can_attach SESSION [USER] 107 114 can_attach() { 108 USER=${2:-"$USER"}115 local USER=${2:-"$USER"} 109 116 [ "$USER" = $(cat "$SESSIONDIR/$1/env/USER") ] 110 117 } … … 120 127 local LOGUSER=$(cat "$SESSIONDIR/$1/env/LOGUSER") 121 128 local LOGGROUP=$(cat "$SESSIONDIR/$1/env/LOGGROUP") 122 USER=${2:-"$USER"}129 local USER=${2:-"$USER"} 123 130 [ "$USER" = "$LOGUSER" ] || in_group "$USER" "$LOGGROUP" || [ $(id -u "$USER") = '0' ] 124 131 } -
trunk/cereal/fs/usr/share/man/man8/cereal-admin.8
r651 r652 64 64 Logs are handled by 65 65 .BR svlogd. 66 For information on how to control session log handling, please see the67 svlogd man page, or the howto included with the documentation included68 withthis package.66 For information on how to control session log handling, please see 67 svlogd(8), or the howto included with the documentation included with 68 this package. 69 69 .PD 70 70 .SH FILES
Note: See TracChangeset
for help on using the changeset viewer.

