From 923fd5673523cc724cbddc088e004dd4448a422d Mon Sep 17 00:00:00 2001 From: Jonas Genannt Date: Thu, 18 Feb 2016 11:10:55 +0100 Subject: [PATCH] added check if init file is a symlink to upstart on Ubuntu 14.04 with needrestart 2.6 without the patch: Scanning processes... WARNING: /etc/init.d/cron has no LSB tags!=== Odd number of elements in hash assignment at /usr/sbin/needrestart line 556, line 119. Use of uninitialized value in list assignment at /usr/sbin/needrestart line 556, line 119. Scanning candidates... Scanning linux images... Running kernel seems to be up-to-date. Services to be restarted: ls -al /etc/init.d/cron lrwxrwxrwx 1 root root 21 Dec 15 2014 /etc/init.d/cron -> /lib/init/upstart-job the new code will check if the init script is a symlink and the symlink points to /lib/init/upstart-job. --- needrestart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/needrestart b/needrestart index 38b3d65..bdca6b0 100755 --- a/needrestart +++ b/needrestart @@ -195,6 +195,13 @@ sub parse_lsbinit($) { my $rc = '/etc/init.d/'.shift; my %lsb; + if ( -l $rc) { + if (readlink($rc) eq '/lib/init/upstart-job') { + print STDERR "WARNING: $rc is a converted upstart job.\n"; + return (); + } + } + open(HLSB, '<', $rc) || die "Can't open $rc: $!\n"; my $found; while(my $line = ) {