Check-Script: init.d Author: Christian Schwarz Abbrev: ini Type: binary Info: Check if a binary package conforms to policy with respect to scripts in /etc/init.d. Needs-Info: init.d, bin-pkg-control Tag: duplicate-updaterc.d-calls-in-postinst Severity: important Certainty: certain Info: The postinst script calls update-rc.d several times for the same /etc/init.d script. Tag: output-of-updaterc.d-not-redirected-to-dev-null Severity: wishlist Certainty: certain Info: The output messages of the update-rc.d command should be redirected to /dev/null because it is currently very chatty per default. Tag: preinst-calls-updaterc.d Severity: important Certainty: certain Info: The preinst package calls update-rc.d. Instead, you should call it in the postinst script. Ref: policy 9.3.3.1 Tag: duplicate-updaterc.d-calls-in-postrm Severity: important Certainty: certain Info: The postrm script calls update-rc.d several times for the same /etc/init.d script. Tag: prerm-calls-updaterc.d Severity: important Certainty: certain Info: The prerm package calls update-rc.d. Instead, you should call it in the postrm script. Ref: policy 9.3.3.1 Tag: postrm-does-not-call-updaterc.d-for-init.d-script Severity: important Certainty: certain Info: An /etc/init.d script which has been registered in the postinst script is not de-registered in the postrm script. Ref: policy 9.3.3.1 Tag: postrm-contains-additional-updaterc.d-calls Severity: important Certainty: certain Info: The postrm de-registers an /etc/init.d script which has not been registered in the postinst script before. Tag: file-in-etc-rc.d-marked-as-conffile Severity: important Certainty: certain Ref: policy 9.3.3 Info: The symbolic links in /etc/rc?.d may not be marked as conffiles. Tag: init.d-script-not-marked-as-conffile Severity: important Certainty: wild-guess Ref: policy 9.3.2 Info: /etc/init.d scripts should be marked as conffiles. . This is usually an error, but the Policy allows for managing these files manually in maintainer scripts and Lintian cannot reliably detect that. Tag: init.d-script-does-not-implement-required-option Severity: important Certainty: certain Ref: policy 9.3.2 Info: The /etc/init.d scripts have to support the following command line arguments: start, stop, restart, force-reload. Tag: init.d-script-does-not-implement-optional-option Severity: wishlist Certainty: certain Ref: http://wiki.debian.org/LSBInitScripts Info: The /etc/init.d script does not implement the status option. This is not required by the Policy, but often requested by users. Tag: init.d-script-not-included-in-package Severity: important Certainty: certain Info: The /etc/init.d script is registered in the postinst script, but is not included in the package. Tag: script-in-etc-init.d-not-registered-via-update-rc.d Severity: normal Certainty: possible Info: The package installs an /etc/init.d script which is not registered in the postinst script. This is usually a bug, unless you omit the links intentionally for some reason or create the links some other way. Tag: upstart-job-in-etc-init.d-not-registered-via-update-rc.d Severity: normal Certainty: possible Info: The package installs an upstart-job in /etc/init.d which is not registered in the postinst script. On non-upstart systems this is usually a bug, unless you omit the links intentionally for some reason or create the links some other way. . This tag should only be emitted for vendors that do not use upstart by default (such as Debian). If this tag is emitted by a vendor using upstart (e.g. Ubuntu), it may be a misconfiguration of their Lintian vendor profile. Tag: init.d-script-has-duplicate-lsb-section Severity: important Certainty: certain Ref: http://wiki.debian.org/LSBInitScripts Info: This /etc/init.d script has more than one LSB keyword section. These sections start with ### BEGIN INIT INFO and end with ### END INIT INFO. There should be only one such section per init script. Tag: init.d-script-has-unterminated-lsb-section Severity: important Certainty: certain Ref: http://wiki.debian.org/LSBInitScripts Info: This /etc/init.d script has an LSB keyword section starting with ### BEGIN INIT INFO but either has no matching ### END INIT INFO or has lines between those two markers that are not comments. The line number given is the first line that doesn't look like part of an LSB keyword section. There must be an end marker after all the keyword settings and there must not be any lines between those markers that do not begin with #. Tag: init.d-script-has-duplicate-lsb-keyword Severity: normal Certainty: certain Ref: http://wiki.debian.org/LSBInitScripts Info: The given keyword was set twice in the LSB keyword section in this /etc/init.d script. This is probably a mistake; the behavior of setting the same keyword twice is undefined. Tag: init.d-script-has-unknown-lsb-keyword Severity: minor Certainty: certain Ref: http://wiki.debian.org/LSBInitScripts Info: The given keyword was set in the LSB keyword section in this /etc/init.d script but isn't one of the known LSB keywords and doesn't begin with X-. One of the standard keywords may have been misspelled. Tag: init.d-script-has-bad-lsb-line Severity: normal Certainty: certain Ref: http://wiki.debian.org/LSBInitScripts Info: This line in the LSB keyword section of an /etc/init.d script doesn't match the required formatting of that section. Note that keyword settings must start with #, a single space, the keyword, a colon, and some whitespace, followed by the value (if any). Only the Description keyword allows continuation lines, and continuation lines must begin with # and either a tab or two or more spaces. Tag: init.d-script-missing-lsb-section Severity: normal Certainty: certain Ref: http://wiki.debian.org/LSBInitScripts Info: This /etc/init.d script does not have an LSB keyword section (or the ### BEGIN INIT INFO tag is incorrect). This section provides description and runlevel information in a standard format and provides dependency information that can be used to parallelize the boot process. Please consider adding it. Tag: init.d-script-missing-lsb-keyword Severity: normal Certainty: certain Ref: http://wiki.debian.org/LSBInitScripts Info: This /etc/init.d script has an LSB keyword section, but it is missing the given required LSB keyword. If the value of this keyword should be empty, please still include it in the LSB keyword section with an empty value. Tag: init.d-script-missing-lsb-short-description Severity: wishlist Certainty: certain Ref: http://wiki.debian.org/LSBInitScripts Info: This /etc/init.d script has an LSB keyword section, but it is missing a Short-Description LSB keyword. This field isn't directly used currently, but adding it is still a good idea for documentation purposes. Tag: init.d-script-missing-lsb-description Severity: wishlist Certainty: certain Ref: http://wiki.debian.org/LSBInitScripts Info: This /etc/init.d script has an LSB keyword section, but it is missing a Description LSB keyword. This field isn't directly used currently, but adding it is still a good idea for documentation purposes. Tag: init.d-script-has-bad-start-runlevel Severity: normal Certainty: certain Ref: http://wiki.debian.org/LSBInitScripts Info: The given runlevel specified in the Default-Start keyword of the LSB keyword section of this /etc/init.d script isn't one of the recognized standard runlevels (S, 0, 1, 2, 3, 4, 5, and 6). Tag: init.d-script-has-bad-stop-runlevel Severity: normal Certainty: certain Ref: http://wiki.debian.org/LSBInitScripts Info: The given runlevel specified in the Default-Stop keyword of the LSB keyword section of this /etc/init.d script isn't one of the recognized standard runlevels (0, 1, 2, 3, 4, 5, and 6). Tag: init.d-script-has-conflicting-start-stop Severity: normal Certainty: certain Ref: http://wiki.debian.org/LSBInitScripts Info: The given runlevel was included in both the Default-Start and Default-Stop keywords of the LSB keyword section of this /etc/init.d script. Since it doesn't make sense to both start and stop a service in the same runlevel, there is probably an error in one or the other of these keywords. Tag: init-d-script-stops-in-s-runlevel Severity: normal Certainty: certain Info: This /etc/init.d script specifies the S runlevel in Default-Stop in its LSB keyword section. The S runlevel is not a real runlevel and is only used during boot. There is no way to switch to it and hence no use for stop scripts for it, so S should be removed from Default-Stop. Tag: init.d-script-uses-usr-interpreter Severity: normal Certainty: possible Info: The given /etc/init.d script specifies an interpreter in its shebang located under /usr. This means the init script will fail if run at a point in the boot sequence before the /usr partition has been mounted. . It also indicates that the init script may be using a non-essential interpreter. Since init scripts are configuration files, they may be left on the system after their package has been removed but not purged. At that point, the package dependencies are not guaranteed to exist and the interpreter may therefore not be available. . It's generally best to write init scripts using /bin/sh or /bin/bash where possible, since they are guaranteed to always be available. Tag: init.d-script-sourcing-without-test Severity: serious Certainty: possible Info: The given /etc/init.d script seems to be sourcing an /etc/default/ file without checking for its existence first. Files in /etc/default/ can be deleted by the administrator at any time, and init scripts are required to handle the situation gracefully. Ref: policy 9.3.2 Tag: init.d-script-starts-in-stop-runlevel Severity: serious Certainty: certain Info: This /etc/init.d script specifies the 0 or 6 runlevels in Default-Start in its LSB keyword section. The 0 and 6 runlevels are meant to only stop services, not to start them. Even if the init script is doing something that isn't exactly stopping a service, the run-level should be listed in Default-Stop, not Default-Start, and the script should perform those actions when passed the stop argument. Tag: init.d-script-provides-virtual-facility Severity: normal Certainty: certain Info: This /etc/init.d script indicates in its LSB headers that it provides a virtual facility, denoted by the dollar sign in front of the name. . This is not the correct way to provide a virtual facility. Instead, the package should include a file in /etc/insserv.conf.d, usually named after the package, containing: . $virtual_facility_name +init-script-name . to declare that the named init script provides the named virtual facility. Ref: http://wiki.debian.org/LSBInitScripts/DebianVirtualFacilities Tag: init.d-script-does-not-provide-itself Severity: minor Certainty: possible Info: This /etc/init.d script indicates it provides one or more facilities, but none of the provided facilities match the name of the init script. In certain cases, it may be necessary to not follow that convention, but normally init scripts should always provide a facility matching the name of the init script. Ref: http://wiki.debian.org/LSBInitScripts Tag: init.d-script-should-depend-on-virtual-facility Severity: important Certainty: possible Info: The given /etc/init.d script depends on a non-virtual facility that should probably be replaced by a virtual facility. For example, init scripts should depend on the virtual facility $network rather than the facility networking, and the virtual facility $named rather than the specific facility bind9. . Properly using virtual facilities allows multiple implementations of the same facility and accommodates systems where that specific facility may not be enough to provide everything the script expects. Tag: init.d-script-possible-missing-stop Severity: normal Certainty: possible Info: The given /etc/init.d script indicates it should be stopped at one of the runlevels 0, 1, or 6 but not at all of them. This is usually a mistake. Normally, facilities that need to be stopped at any of those runlevels need to be stopped at all of them. . For example, if it is safe for the facility provided by this init script to be stopped by sendsigs at runlevels 0 and 6, there should be no reason to special case runlevel 1, where killprocs would stop it. If the facility needs special shutdown handling when rebooting the system (runlevel 6), it probably needs the same handling when halting the system (runlevel 0) or switching to single-user mode (runlevel 1). Tag: init.d-script-missing-start Severity: normal Certainty: certain Info: The given /etc/init.d script indicates it should be started at one of the runlevels 2-5 but not at all of them. This is a mistake. The system administrators should be given the opportunity to customize the runlevels at their will. Ref: policy 9.3.3.1 Tag: init.d-script-missing-dependency-on-remote_fs Severity: important Certainty: possible Info: The given init script seems to refer to /usr, possibly using a file or binary from there. Without a dependency on $remote_fs in Required-Start or Required-Stop, as appropriate, the init script might be run before /usr is mounted or after it's unmounted. . Using Should-Start or Should-Stop to declare the dependency is conceptually incorrect since the $remote_fs facility is always available. Required-Start or Required-Stop should be used instead. Also, please note that $all should not be used in Required-Stop, only Required-Start. Ref: http://wiki.debian.org/LSBInitScripts Tag: init.d-script-missing-dependency-on-local_fs Severity: important Certainty: possible Info: The given init script seems to refer to /var, possibly using a file from there. Without a dependency on $local_fs in Required-Start or Required-Stop, as appropriate, the init script might be run before /var is mounted or after it's unmounted. . Using Should-Start or Should-Stop to declare the dependency is conceptually incorrect since the $local_fs facility is always available. Required-Start or Required-Stop should be used instead. Ref: http://wiki.debian.org/LSBInitScripts Tag: init.d-script-depends-on-unknown-virtual-facility Severity: serious Certainty: possible Info: The given init script declares a dependency on a virtual facility that is not known to be provided by any init.d script in the archive. If the dependency can not be satisfied upon the package's installation, insserv will refuse the activation of the init.d script. Ref: http://wiki.debian.org/LSBInitScripts