Changeset 5964 for lm-sensors/trunk/prog

Show
Ignore:
Timestamp:
04/27/11 19:35:18 (13 months ago)
Author:
jwrdegoede
Message:

systemd integration

Location:
lm-sensors/trunk/prog
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/prog/detect/sensors-detect

    r5963 r5964  
    24162416                # Try some known default udev db locations, just in case 
    24172417                if (-e '/dev/.udev.tdb' || -e '/dev/.udev' 
    2418                  || -e '/dev/.udevdb') { 
     2418                 || -e '/dev/.udevdb' || -e '/run/udev') { 
    24192419                        $use_udev = 1; 
    24202420                        $dev_i2c = '/dev/i2c-'; 
     
    64606460                close(SYSCONFIG); 
    64616461 
     6462                if (-x "/bin/systemctl" && -d "/lib/systemd/system" && 
     6463                    ! -f "/lib/systemd/system/lm_sensors.service") { 
     6464                        print "Copy prog/init/lm_sensors.service to /lib/systemd/system\n". 
     6465                              "and run 'systemctl enable lm_sensors.service'\n". 
     6466                              "for initialization at boot time.\n"; 
     6467                        return; 
     6468                } 
     6469 
     6470                if (-x "/bin/systemctl" && 
     6471                    -f "/lib/systemd/system/lm_sensors.service") { 
     6472                        system("/bin/systemctl", "enable", "lm_sensors.service"); 
     6473                        system("/bin/systemctl", "start", "lm_sensors.service"); 
     6474                        # All done, don't check for /etc/init.d/lm_sensors 
     6475                        return; 
     6476                } 
     6477 
    64626478                print "Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors\n". 
    64636479                      "for initialization at boot time.\n" 
     
    65156531        } 
    65166532 
    6517         if (-x "/sbin/service" && -f "/etc/init.d/lm_sensors" && 
    6518             -f "/var/lock/subsys/lm_sensors") { 
     6533        if (-x "/bin/systemctl" && -f "/lib/systemd/system/lm_sensors.service") { 
     6534                system("/bin/systemctl", "stop", "lm_sensors.service"); 
     6535        } elsif (-x "/sbin/service" && -f "/etc/init.d/lm_sensors" && 
     6536                 -f "/var/lock/subsys/lm_sensors") { 
    65196537                system("/sbin/service", "lm_sensors", "stop"); 
    65206538        }