07 Mar 2007 Çar tarihinde, S.Çağlar Onur şunları yazmıştı: > This is the 3rd version of "use service binary unconditionally without > checking /etc/init.d/$ existence" patch which disscussed this list 2 months > ago, its basically rebased against current CVS tree, if there is no > objection i strongly suggest applying this, we already using "service" > command on "pm/functions" in stopservice to check service status. Plus > Pardus (which uses pm-utils on its default installation) has no concept > like init script so upstream version is always fails for us for that check.
Heh, and the actual patch :) -- S.Çağlar Onur <[EMAIL PROTECTED]> http://cekirdek.pardus.org.tr/~caglar/ Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
Index: pm/functions
===================================================================
RCS file: /cvs/pm-utils/pm-utils/pm/functions,v
retrieving revision 1.36
diff -u -r1.36 functions
--- pm/functions 6 Mar 2007 19:59:05 -0000 1.36
+++ pm/functions 8 Mar 2007 12:14:08 -0000
@@ -1,5 +1,6 @@
#!/bin/bash
-
+# To get rid of localized outputs
+export LC_ALL=C
export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/pm-utils/bin
# Default values go here. It is important to _not_ initialize some
@@ -225,17 +226,16 @@
stopservice()
{
service "$1" status 2>/dev/null | grep -c -q running
- if [ "$?" == "0" -a -x "/etc/init.d/$1" ]; then
+ if [ "$?" == "0" ]; then
echo "export ${1}_SERVICE_ACTIVATE=yes" >> /var/run/pm-suspend
- "/etc/init.d/$1" stop 2>&1
+ service "$1" stop 2>&1
fi
}
restartservice()
{
- if [ "x$(eval echo \$${1}_SERVICE_ACTIVATE)" == "xyes" \
- -a -x "/etc/init.d/$1" ]; then
- "/etc/init.d/$1" start 2>&1
+ if [ "x$(eval echo \$${1}_SERVICE_ACTIVATE)" == "xyes" ]; then
+ service "$1" start 2>&1
fi
}
pgpGo0XRv6m95.pgp
Description: PGP signature
_______________________________________________ Pm-utils mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/pm-utils
