On Jan 10, 2008 9:10 PM, Wee Yeh Tan <weeyeh at gmail.com> wrote: > On Jan 10, 2008 12:27 PM, Mark Martin <storycrafter at gmail.com> wrote: > > I suppose you could workaround with: > > > > svcs -x | grep "maint" > > I might be missing something but with 'svcs | grep <state>', you get > both the service & their status. Why is '-x' interesting if the only > thing the admin wants is to know if any service needs maintenance. >
With "-x" (alone) you get non running services (yet are enabled) and blocking services -- what I take to mean services in a degraded state. Tacking a flag to quiesce "-x" to an error code does make some sense to me. Otherwise, you're stuck with something along the lines of : #forgive my meager shell script-fu if [ `svcs 2>/devnull -x | grep "maint" | wc -l' -ne 0 ]; then echo "One or more troubled services exist" else echo "No troubled services here, m'lord" fi Yeah, you could probably do the same grep-fu with just "svcs", but adding a flag to the option which is supposed to just report troubled services makes more sense to me. I'm sure the intent of "-x" was as diagnostic in the sense of troubleshooting, as it does get verbose in the default invocation. My hope here is that this is a simple additional and optional flag doesn't cause fast-track derailment because tons of workaround exists. In my mind, it's just a low hanging fruit that might make one more customer happy without a lot of fuss. I'm willing to be wrong, though, on at least two of those three assumptions. Mark