Changeset 555
- Timestamp:
- Sep 6, 2007 2:01:37 PM (6 years ago)
- Location:
- trunk/cereal
- Files:
-
- 4 edited
-
debian/changelog (modified) (1 diff)
-
fs/usr/bin/cereal (modified) (1 diff)
-
fs/usr/sbin/cereal-admin (modified) (2 diffs)
-
fs/usr/share/cereal/common (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/cereal/debian/changelog
r553 r555 1 cereal (0.13-1) unstable; urgency=low 2 3 * update of is_running function with better tests/return 4 5 -- Jameson Rollins <jrollins@fifthhorseman.net> Thu, 06 Sep 2007 14:00:12 -0400 6 1 7 cereal (0.12-1) unstable; urgency=high 2 8 -
trunk/cereal/fs/usr/bin/cereal
r553 r555 43 43 failure "Session '$SESSION' not found. 44 44 Type 'cereal list' to list sessions." 45 elif ! is_ linked"$SESSION" ; then46 failure "Session '$SESSION' does not appear to berunning."45 elif ! is_running "$SESSION" ; then 46 failure "Session '$SESSION' not running." 47 47 elif ! can_attach "$SESSION" "$USER" ; then 48 48 failure "You are not allowed to attach to session '$SESSION'." -
trunk/cereal/fs/usr/sbin/cereal-admin
r551 r555 140 140 continue 141 141 elif ! chpst -e "$SESSIONDIR/$SESSION/env/" sh -c start_check ; then 142 echo "Session '$SESSION' no properly configured."142 echo "Session '$SESSION' not properly configured." 143 143 ((ERR++)) 144 144 continue … … 179 179 continue 180 180 elif ! is_linked "$SESSION" ; then 181 echo "Session '$SESSION' not running."181 echo "Session '$SESSION' not linked." 182 182 ((ERR++)) 183 183 continue -
trunk/cereal/fs/usr/share/cereal/common
r551 r555 79 79 # is_running SESSION 80 80 is_running() { 81 grep -q run "$SERVICE.$1/supervise/stat" 81 local SD="$SERVICE.$1" 82 # if session is linked in service dir... 83 if [ -L "$SD" ] ; then 84 # return 2 if supervise/stat says that the service is *not* running 85 if [ -r "$SD/supervise/stat" ] && ! grep -q run "$SD/supervise/stat" ; then 86 return 2 87 fi 88 # otherwise return 0 since either it is running, or we can't tell 89 # whether the service is actually running or not, so assume that it is 90 # if it's linked. 91 return 0 92 else 93 # return 1 if it's not linked 94 return 1 95 fi 82 96 } 83 97 export -f is_running … … 119 133 is_session "$SESSION" || failure "Session '$SESSION' not found." 120 134 121 # set state flag ('+' linked , '-' stopped, '!' linked but stopped)122 # (last flag works only for users that can read supervise/stat)135 # set state flag ('+' linked (0), '-' stopped (1), '!' linked but stopped(2)) 136 # last flag works only for users that can read supervise/stat 123 137 SFLAG='-' 124 if is_linked "$SESSION" ; then 125 SFLAG='+' 126 if [ -r "$SERVICE.$SESSION/supervise/stat" ] && ! is_running "$SESSION" ; then 138 is_running "$SESSION" 139 case $? in 140 0) 141 SFLAG='+' 142 ;; 143 1) 144 SFLAG='-' 145 ;; 146 2) 127 147 SFLAG='!' 128 fi129 fi148 ;; 149 esac 130 150 # set attach flag 131 151 AFLAG='-'
Note: See TracChangeset
for help on using the changeset viewer.

