init-checkconf returns seemingly random results

Bug #1400495 reported by Rich Drewes
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
upstart (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

While tracking down a problem related to upstart, I decided to check the syntax of all my upstart init files. I wrote this simple script:

for a in /etc/init/*; do init-checkconf $a; done 2>&1 | grep invalid

This script said that a number of files had syntax errors. When the file with the error is checked individually on the command line with init-checkconf, it shows no error.

Running the script again showed a different set of files with errors. Checking each file individually on the command line does not show an error.

Running it a third time gave yet another set of files with errors.

Why would this give different results each time it is run? Why does init-checkconf report seemingly random syntax errors when run in a script?

Rich

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: upstart 1.12.1-0ubuntu4.2
ProcVersionSignature: Ubuntu 3.13.0-32.57-generic 3.13.11.4
Uname: Linux 3.13.0-32-generic x86_64
.etc.init.glusterfs.server.override: manual
.etc.init.mounting.glusterfs.override: manual
.etc.init.mysql.override: manual
ApportVersion: 2.14.1-0ubuntu3.5
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Dec 8 13:08:53 2014
ProcKernelCmdline: BOOT_IMAGE=/boot/vmlinuz-3.13.0-32-generic root=UUID=0feac9b2-7f2c-44ed-af0a-e7ace6c02b41 ro nomdmonddf nomdmonisw nomdmonddf nomdmonisw
SourcePackage: upstart
UpgradeStatus: Upgraded to trusty on 2014-04-19 (233 days ago)
UpstartBugCategory: System
UpstartRunningSessionVersion: init (upstart 1.12.1)
UpstartRunningSystemVersion: init (upstart 1.12.1)
modified.conffile..etc.at.deny: [inaccessible: [Errno 13] Permission denied: '/etc/at.deny']
modified.conffile..etc.dconf.db.gdm: [modified]
modified.conffile..etc.default.cups: [modified]
modified.conffile..etc.init.d.smbd: [modified]
modified.conffile..etc.vsftpd.conf: [modified]
mtime.conffile..etc.dconf.db.gdm: 2014-07-31T12:57:17
mtime.conffile..etc.default.cups: 2014-04-19T12:34:54
mtime.conffile..etc.init.d.smbd: 2014-12-08T11:57:38.341196
mtime.conffile..etc.vsftpd.conf: 2014-06-06T13:12:21

Revision history for this message
Rich Drewes (drewes) wrote :
Revision history for this message
Rich Drewes (drewes) wrote :

For example, here are two consecutive runs of the script showing different results:

root@ladastra:/etc/init# for a in /etc/init/*; do init-checkconf $a; done 2>&1 | grep invalid
ERROR: File /etc/init/alsa-state.conf: syntax invalid:
ERROR: File /etc/init/alsa-store.conf: syntax invalid:
ERROR: File /etc/init/avahi-daemon.conf: syntax invalid:
ERROR: File /etc/init/binfmt-support.conf: syntax invalid:
ERROR: File /etc/init/bluetooth.conf: syntax invalid:
ERROR: File /etc/init/cryptdisks.conf: syntax invalid:
ERROR: File /etc/init/ecryptfs-utils-save.conf: syntax invalid:
ERROR: File /etc/init/glusterfs-server.conf: syntax invalid:
ERROR: File /etc/init/lightdm.conf: syntax invalid:
ERROR: File /etc/init/mountall-shell.conf: syntax invalid:
ERROR: File /etc/init/mountdevsubfs.sh.conf: syntax invalid:
ERROR: File /etc/init/mountnfs.sh.conf: syntax invalid:
ERROR: File /etc/init/nvidia-persistenced.conf: syntax invalid:
ERROR: File /etc/init/qemu-kvm.conf: syntax invalid:
ERROR: File /etc/init/reload-smbd.conf: syntax invalid:
ERROR: File /etc/init/resolvconf.conf: syntax invalid:
ERROR: File /etc/init/startpar-bridge.conf: syntax invalid:
ERROR: File /etc/init/tty5.conf: syntax invalid:
ERROR: File /etc/init/upstart-socket-bridge.conf: syntax invalid:
ERROR: File /etc/init/ureadahead-other.conf: syntax invalid:
ERROR: File /etc/init/whoopsie.conf: syntax invalid:
root@ladastra:/etc/init# for a in /etc/init/*; do init-checkconf $a; done 2>&1 | grep invalid
ERROR: File /etc/init/console-font.conf: syntax invalid:
ERROR: File /etc/init/failsafe.conf: syntax invalid:
ERROR: File /etc/init/hwclock-save.conf: syntax invalid:
ERROR: File /etc/init/mountall-bootclean.sh.conf: syntax invalid:
ERROR: File /etc/init/mountall-net.conf: syntax invalid:
ERROR: File /etc/init/mountall-reboot.conf: syntax invalid:
ERROR: File /etc/init/mountall-shell.conf: syntax invalid:
ERROR: File /etc/init/mounted-run.conf: syntax invalid:
ERROR: File /etc/init/passwd.conf: syntax invalid:
ERROR: File /etc/init/plymouth.conf: syntax invalid:
ERROR: File /etc/init/plymouth-splash.conf: syntax invalid:
ERROR: File /etc/init/rfkill-store.conf: syntax invalid:
ERROR: File /etc/init/statd-mounting.conf: syntax invalid:
ERROR: File /etc/init/systemd-logind.conf: syntax invalid:
ERROR: File /etc/init/tty1.conf: syntax invalid:

Then if I run the check on the single file tty1.conf, which returned a syntax error on the scripted run, it returns no error:

root@ladastra:/etc/init# init-checkconf /etc/init/tty1.conf
File /etc/init/tty1.conf: syntax ok

Revision history for this message
Rich Drewes (drewes) wrote :

Actually, it seems there isn't anything in particular about being in a script that causes init-checkconf to return random results. If I repeat the same command a number of times the results vary:

----
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
File /etc/init/tty5.conf: syntax ok
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
File /etc/init/tty5.conf: syntax ok
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
File /etc/init/tty5.conf: syntax ok
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
ERROR: File /etc/init/tty5.conf: syntax invalid:
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
File /etc/init/tty5.conf: syntax ok
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
File /etc/init/tty5.conf: syntax ok
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
File /etc/init/tty5.conf: syntax ok
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
File /etc/init/tty5.conf: syntax ok
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
File /etc/init/tty5.conf: syntax ok
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
File /etc/init/tty5.conf: syntax ok
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
File /etc/init/tty5.conf: syntax ok
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
File /etc/init/tty5.conf: syntax ok
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
File /etc/init/tty5.conf: syntax ok
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
File /etc/init/tty5.conf: syntax ok
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
ERROR: File /etc/init/tty5.conf: syntax invalid:
root@ladastra:/oldroot/home/drewes# init-checkconf /etc/init/tty5.conf
File /etc/init/tty5.conf: syntax ok
----

As is evident, sometimes the syntax is reported as being ok and sometimes invalid.

Rich

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in upstart (Ubuntu):
status: New → Confirmed
Revision history for this message
Leandro Heck (leoheck) wrote :

Same here in the land of Ubuntu 16.04. Please fix this! Sometimes it works, sometimes don't. I didn't touch the .conf file bat it is opened in the text editor.

✘ lheck@moon  ~/Desktop  init-checkconf /etc/init/gaph.conf
File /etc/init/gaph.conf: syntax ok
 lheck@moon  ~/Desktop  init-checkconf /etc/init/gaph.conf
File /etc/init/gaph.conf: syntax ok
 lheck@moon  ~/Desktop  init-checkconf /etc/init/gaph.conf
ERROR: File /etc/init/gaph.conf: syntax invalid:
 ✘ lheck@moon  ~/Desktop  init-checkconf /etc/init/gaph.conf
ERROR: File /etc/init/gaph.conf: syntax invalid:

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.