Skip to content

Commit

Permalink
apcupsd - don't let rc script start if it's already running
Browse files Browse the repository at this point in the history
(cherry picked from commit 7112be2)
  • Loading branch information
dbaio authored and rbgarga committed Aug 19, 2016
1 parent 7a10629 commit 707948f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sysutils/pfSense-pkg-apcupsd/files/usr/local/pkg/apcupsd.inc
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ function sync_package_apcupsd() {
if (is_array($apcupsd_config) && $apcupsd_config['apcupsdenabled']=="on") {

$apcupsd_start = "echo \"Starting APC UPS Daemon...\"\n";
$apcupsd_start .= " if [ -f /var/run/apcupsd.pid ]; then \n";
$apcupsd_start .= " echo \"Already running\" \n";
$apcupsd_start .= " exit 1 \n";
$apcupsd_start .= " fi \n";
$apcupsd_start .= " if [ ! -d {$lockfile} ]; then \n";
$apcupsd_start .= " /bin/mkdir -p {$lockfile} \n";
$apcupsd_start .= " fi \n";
Expand Down

0 comments on commit 707948f

Please sign in to comment.