From c1fd61c0b7fedd0198d951c7e4466fd0566100f2 Mon Sep 17 00:00:00 2001 From: Ryan Wagoner Date: Mon, 19 Feb 2007 20:40:53 +0000 Subject: -fix permission problem when using usb ups --- packages/nut/nut.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/nut/nut.inc b/packages/nut/nut.inc index b26b405f..d9097788 100644 --- a/packages/nut/nut.inc +++ b/packages/nut/nut.inc @@ -251,8 +251,10 @@ EOD; chown($port, 'uucp'); /* ups.conf */ - if($port == 'auto') + if($port == 'auto') { $ups_conf = "user=root\n"; + $ovr_user = '-u root'; + } $ups_conf .= "[{$name}]\n"; $ups_conf .= "driver={$driver}\n"; $ups_conf .= "port={$port}\n"; @@ -324,7 +326,7 @@ if [ `pgrep {$driver} | wc -l` != 0 ]; then echo starting {$driver} if /usr/local/libexec/nut/upsdrvctl start; then echo starting upsd - /usr/local/sbin/upsd + /usr/local/sbin/upsd {$ovr_user} echo starting upsmon /usr/local/sbin/upsmon {$name}@localhost else -- cgit v1.2.3