Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd perl warnings about LSB tags #33

Closed
evgkrsk opened this issue Jun 25, 2016 · 10 comments
Closed

Odd perl warnings about LSB tags #33

evgkrsk opened this issue Jun 25, 2016 · 10 comments
Assignees
Milestone

Comments

@evgkrsk
Copy link

evgkrsk commented Jun 25, 2016

[root@www-srvc1 ~]# cat /etc/centos-release 
CentOS release 6.7 (Final)
[root@www-srvc1 ~]# needrestart -l -r l
Scanning processes...                                                                                                                          
WARNING: /etc/init.d/auditd has no LSB tags!                                                                                                 ]
Odd number of elements in hash assignment at /usr/sbin/needrestart line 592, <HLSB> line 175.
Use of uninitialized value in list assignment at /usr/sbin/needrestart line 592, <HLSB> line 175.
WARNING: /etc/init.d/pure-ftpd has no LSB tags!                                                                                              ]
Odd number of elements in hash assignment at /usr/sbin/needrestart line 592, <HLSB> line 83.
Use of uninitialized value in list assignment at /usr/sbin/needrestart line 592, <HLSB> line 83.
WARNING: /etc/init.d/bacula-fd has no LSB tags!===================================================================                           ]
Odd number of elements in hash assignment at /usr/sbin/needrestart line 592, <HLSB> line 100.
Use of uninitialized value in list assignment at /usr/sbin/needrestart line 592, <HLSB> line 100.
Scanning candidates...                                                                                                                         
Services to be restarted:
 service auditd restart
 service bacula-fd restart
 service cups restart
 service dovecot restart
 service ihttpd restart
 service named restart
 service ntpd restart
 service php-fpm restart
 service pure-ftpd restart
 service zabbix-agent restart
No containers need to be restarted.
No user sessions are running outdated binaries.
[root@www-srvc1 ~]# perl --version

This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

Copyright 1987-2009, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
@liske liske added the bug label Aug 25, 2016
@liske liske self-assigned this Aug 25, 2016
@liske liske added this to the v2.9 milestone Aug 25, 2016
@liske
Copy link
Owner

liske commented Aug 25, 2016

Hi,

could you please provide one of the affected init.d files:

  • /etc/init.d/auditd
  • /etc/init.d/pure-ftpd
  • /etc/init.d/bacula-fd

needrestart seems to have problems to recorgnize the LSB tags of this files.

Thanks,
Thomas

liske added a commit that referenced this issue Aug 25, 2016
@evgkrsk
Copy link
Author

evgkrsk commented Aug 25, 2016

Sure, I can, but do you still needs it (with commit c0a2f7a already in master)?

@liske
Copy link
Owner

liske commented Aug 25, 2016

The perl warnings should have vanished with c0a2f7a, but needresart still fails to parse the LSB tags from those init.d files. Since I do not have a CentOS 6.7 system at hand I still need it.

Thanks,
Thomas

@evgkrsk
Copy link
Author

evgkrsk commented Aug 25, 2016

There one of those files, as you asked.

@liske
Copy link
Owner

liske commented Aug 25, 2016

Thanks! I was not aware that chkconfig uses it's own (legacy?) header format rather than LSB tags. It might be easily to implement the handling of chkconfig's headers format like for the LSB tags.

@liske
Copy link
Owner

liske commented Aug 25, 2016

I've added parsing of chkconfig tags if there are no LSB tags in Sys-V init files. Could you please give fff7b0e a try (while one of the affected daemons require a restart)? There should no more perl warings nor LSB-tags-missing complains of needrestart.

@evgkrsk
Copy link
Author

evgkrsk commented Aug 26, 2016

There no more perl warning, but its ignoring exim service during my check:

[root@plugins5]~# /usr/sbin/needrestart.bak -b -n -l -r l           
NEEDRESTART-VER: 2.8
WARNING: /etc/init.d/exim has no LSB tags!
Odd number of elements in hash assignment at /usr/sbin/needrestart.bak line 592, <HLSB> line 132.
Use of uninitialized value in list assignment at /usr/sbin/needrestart.bak line 592, <HLSB> line 132.
NEEDRESTART-SVC: crond
NEEDRESTART-SVC: dovecot
NEEDRESTART-SVC: exim
NEEDRESTART-SVC: proftpd
NEEDRESTART-SVC: sshd
[root@plugins5]~# /usr/sbin/needrestart -b -n -l -r l -v
[main] eval /etc/needrestart/needrestart.conf
[main] running in root-mode
NEEDRESTART-VER: 2.8
[main] #1617 uses non-existing /usr/libexec/dovecot/anvil
[main] #1617 is a child of #1615
[main] #1650 uses obsolete binary /usr/sbin/proftpd
[main] #1650 is not a child
[main] #1688 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #1688 is not a child
[main] #1717 uses deleted /lib64/libfreebl3.so
[main] #1717 is not a child
[main] #4624 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #4624 is a child of #1688
[main] #5367 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #5367 is a child of #1688
[main] #8549 uses deleted /lib64/libpcre.so.0.0.1.#prelink#.hhaD8F
[main] #8549 is not a child
[main] #24204 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #24204 is a child of #1688
[main] #24205 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #24205 is a child of #1688
[main] #24206 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #24206 is a child of #1688
[main] #24207 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #24207 is a child of #1688
[main] #24208 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #24208 is a child of #1688
[main] #29066 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #29066 is a child of #1688
[main] #1615 exe => /usr/sbin/dovecot
[main] #1615 running /etc/needrestart/hook.d/10-dpkg
[main] #1615 running /etc/needrestart/hook.d/20-rpm
[main] #1615 package: dovecot-2.0.9-22.el6.x86_64
[main] no LSB headers found at dovecot
[main] #1650 exe => /usr/sbin/proftpd
[main] #1650 running /etc/needrestart/hook.d/10-dpkg
[main] #1650 running /etc/needrestart/hook.d/20-rpm
[main] #1650 package: proftpd-1.3.3g-10.el6.x86_64
[main] no LSB headers found at proftpd
[main] #1688 exe => /usr/sbin/httpd.itk
[main] #1688 running /etc/needrestart/hook.d/10-dpkg
[main] #1688 running /etc/needrestart/hook.d/20-rpm
[main] #1688 package: httpd-itk-2.2.22-7.el6.x86_64
[main] #1688 running /etc/needrestart/hook.d/30-pacman
[main] #1688 running /etc/needrestart/hook.d/90-none
[main] #1717 exe => /usr/sbin/crond
[main] #1717 running /etc/needrestart/hook.d/10-dpkg
[main] #1717 running /etc/needrestart/hook.d/20-rpm
[main] #1717 package: cronie-1.4.4-15.el6_7.1.x86_64
[main] #1717 has been started by crond - triggering
[main] #8549 exe => /usr/sbin/exim
[main] #8549 running /etc/needrestart/hook.d/10-dpkg
[main] #8549 running /etc/needrestart/hook.d/20-rpm
[main] #8549 package: exim-4.84.2-3.el6.x86_64
[main] /etc/init.d/exim is missing LSB tags, found chkconfig tags instead
[main] #8549 rc.d script exim should not start in the current run-level(3)
[main] #8549 running /etc/needrestart/hook.d/30-pacman
[main] #8549 running /etc/needrestart/hook.d/90-none
[main] #8549 package: exim
[main] /etc/init.d/exim is missing LSB tags, found chkconfig tags instead
[main] #8549 rc.d script exim should not start in the current run-level(3)
NEEDRESTART-SVC: crond
NEEDRESTART-SVC: dovecot
NEEDRESTART-SVC: proftpd
[root@plugins5]~# head /etc/init.d/exim 
#!/bin/bash
#
# exim    This shell script takes care of starting and stopping exim
#
# chkconfig: 2345 80 30
# description: Exim is a Mail Transport Agent, which is the program \
#              that moves mail from one machine to another.
# processname: exim
# config: /etc/exim/exim.conf
# pidfile: /var/run/exim.pid
[root@plugins5]~# chkconfig --list exim 
exim            0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@plugins5]~# service exim status
exim (pid  8549) is running...
[root@plugins5]~# 

liske added a commit that referenced this issue Aug 26, 2016
@liske
Copy link
Owner

liske commented Aug 26, 2016

There was a silly bug in the chkconfig to LSB tag mapping. It should work now, could you give 9bb6aa6 another try? Thanks!

@evgkrsk
Copy link
Author

evgkrsk commented Aug 27, 2016

Check result for latest version in master branch:

[root@plugins5 ~]# /usr/sbin/needrestart.bak -b -n -l -r l
NEEDRESTART-VER: 2.8
WARNING: /etc/init.d/exim has no LSB tags!
Odd number of elements in hash assignment at /usr/sbin/needrestart.bak line 592, <HLSB> line 132.
Use of uninitialized value in list assignment at /usr/sbin/needrestart.bak line 592, <HLSB> line 132.
NEEDRESTART-SVC: crond
NEEDRESTART-SVC: dovecot
NEEDRESTART-SVC: exim
NEEDRESTART-SVC: proftpd
[root@plugins5 ~]# /usr/sbin/needrestart -b -n -l -r l 
NEEDRESTART-VER: 2.8
Use of uninitialized value $lsb{"default-start"} in pattern match (m//) at /usr/sbin/needrestart line 632.
Use of uninitialized value $lsb{"default-start"} in pattern match (m//) at /usr/sbin/needrestart line 632.
NEEDRESTART-SVC: crond
NEEDRESTART-SVC: dovecot
NEEDRESTART-SVC: proftpd
[root@plugins5 ~]# /usr/sbin/needrestart -b -n -l -r l  -v
[main] eval /etc/needrestart/needrestart.conf
[main] running in root-mode
NEEDRESTART-VER: 2.8
[main] #1617 uses non-existing /usr/libexec/dovecot/anvil
[main] #1617 is a child of #1615
[main] #1650 uses obsolete binary /usr/sbin/proftpd
[main] #1650 is not a child
[main] #1688 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #1688 is not a child
[main] #1717 uses deleted /lib64/libfreebl3.so
[main] #1717 is not a child
[main] #4624 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #4624 is a child of #1688
[main] #5367 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #5367 is a child of #1688
[main] #8549 uses deleted /lib64/libpcre.so.0.0.1.#prelink#.hhaD8F
[main] #8549 is not a child
[main] #24204 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #24204 is a child of #1688
[main] #24205 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #24205 is a child of #1688
[main] #24206 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #24206 is a child of #1688
[main] #24207 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #24207 is a child of #1688
[main] #24208 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #24208 is a child of #1688
[main] #29066 uses deleted /usr/lib64/libsasl2.so.2.0.23.#prelink#.kfd7YI
[main] #29066 is a child of #1688
[main] #1615 exe => /usr/sbin/dovecot
[main] #1615 running /etc/needrestart/hook.d/10-dpkg
[main] #1615 running /etc/needrestart/hook.d/20-rpm
[main] #1615 package: dovecot-2.0.9-22.el6.x86_64
[main] no LSB headers found at dovecot
[main] #1650 exe => /usr/sbin/proftpd
[main] #1650 running /etc/needrestart/hook.d/10-dpkg
[main] #1650 running /etc/needrestart/hook.d/20-rpm
[main] #1650 package: proftpd-1.3.3g-10.el6.x86_64
[main] no LSB headers found at proftpd
[main] #1688 exe => /usr/sbin/httpd.itk
[main] #1688 running /etc/needrestart/hook.d/10-dpkg
[main] #1688 running /etc/needrestart/hook.d/20-rpm
[main] #1688 package: httpd-itk-2.2.22-7.el6.x86_64
[main] #1688 running /etc/needrestart/hook.d/30-pacman
[main] #1688 running /etc/needrestart/hook.d/90-none
[main] #1717 exe => /usr/sbin/crond
[main] #1717 running /etc/needrestart/hook.d/10-dpkg
[main] #1717 running /etc/needrestart/hook.d/20-rpm
[main] #1717 package: cronie-1.4.4-15.el6_7.1.x86_64
[main] #1717 has been started by crond - triggering
[main] #8549 exe => /usr/sbin/exim
[main] #8549 running /etc/needrestart/hook.d/10-dpkg
[main] #8549 running /etc/needrestart/hook.d/20-rpm
[main] #8549 package: exim-4.84.2-3.el6.x86_64
[main] /etc/init.d/exim is missing LSB tags, found chkconfig tags instead
Use of uninitialized value $lsb{"default-start"} in pattern match (m//) at /usr/sbin/needrestart line 632.
[main] #8549 rc.d script exim should not start in the current run-level(2)
[main] #8549 running /etc/needrestart/hook.d/30-pacman
[main] #8549 running /etc/needrestart/hook.d/90-none
[main] #8549 package: exim
[main] /etc/init.d/exim is missing LSB tags, found chkconfig tags instead
Use of uninitialized value $lsb{"default-start"} in pattern match (m//) at /usr/sbin/needrestart line 632.
[main] #8549 rc.d script exim should not start in the current run-level(2)
NEEDRESTART-SVC: crond
NEEDRESTART-SVC: dovecot
NEEDRESTART-SVC: proftpd
[root@plugins5 ~]# head /etc/init.d/exim 
#!/bin/bash
#
# exim    This shell script takes care of starting and stopping exim
#
# chkconfig: 2345 80 30
# description: Exim is a Mail Transport Agent, which is the program \
#              that moves mail from one machine to another.
# processname: exim
# config: /etc/exim/exim.conf
# pidfile: /var/run/exim.pid
[root@plugins5 ~]# chkconfig --list exim
exim            0:выкл  1:выкл  2:вкл    3:вкл    4:вкл    5:вкл    6:выкл
[root@plugins5 ~]# service exim status
exim (pid  8549) is running...
[root@plugins5 ~]# 

liske added a commit that referenced this issue Aug 27, 2016
@liske
Copy link
Owner

liske commented Aug 27, 2016

There was a typo resulting in another perl warning Use of uninitialized value $lsb{"default-start"}, it (062d309) should work now.

@liske liske closed this as completed Aug 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants