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

service resource misbehaves on upstart hosts #226

Closed
zmalone opened this issue Nov 9, 2015 · 5 comments
Closed

service resource misbehaves on upstart hosts #226

zmalone opened this issue Nov 9, 2015 · 5 comments

Comments

@zmalone
Copy link
Contributor

zmalone commented Nov 9, 2015

Some services, like ntp, don't show up in initctl on Ubuntu 14.04 and other pre-systemd platforms. They are visible in /etc/init.d and via the service command, but are not in initctl.

Currently, inspec checks initctl for all service resources on pre-15.04 hosts, so it will fail to detect running ntp processes, even though they are present and enabled.

I'm not sure what the proper fix here is, possibly checking /etc/init.d/, service, and initctl for a service, and or-ing the results together?

@chris-rock
Copy link
Contributor

Hi @zmalone We used initctl due to the fact that Ubuntu recommends it http://upstart.ubuntu.com/cookbook/#initctl

Will double-check why this does not work with Ubuntu 14.04. Any special configuration?

@zmalone
Copy link
Contributor Author

zmalone commented Nov 9, 2015

It's unfortunately a default config. I believe this is just Ubuntu being inconsistent, but it happens with a few Ubuntu services, so checking init.d and the service command is probably necessary. This is a base Ubuntu 14.04 install:

vagrant@vm:~$ sudo apt-get install ntp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libopts25
Suggested packages:
  ntp-doc
The following NEW packages will be installed:
  libopts25 ntp
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 474 kB of archives.
After this operation, 1,677 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libopts25 amd64 1:5.18-2ubuntu2 [55.3 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty-updates/main ntp amd64 1:4.2.6.p5+dfsg-3ubuntu2.14.04.5 [419 kB]
Fetched 474 kB in 3s (129 kB/s)
Selecting previously unselected package libopts25:amd64.
(Reading database ... 69251 files and directories currently installed.)
Preparing to unpack .../libopts25_1%3a5.18-2ubuntu2_amd64.deb ...
Unpacking libopts25:amd64 (1:5.18-2ubuntu2) ...
Selecting previously unselected package ntp.
Preparing to unpack .../ntp_1%3a4.2.6.p5+dfsg-3ubuntu2.14.04.5_amd64.deb ...
Unpacking ntp (1:4.2.6.p5+dfsg-3ubuntu2.14.04.5) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up libopts25:amd64 (1:5.18-2ubuntu2) ...
Setting up ntp (1:4.2.6.p5+dfsg-3ubuntu2.14.04.5) ...
 * Starting NTP server ntpd                                              [ OK ] 
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Processing triggers for ureadahead (0.100.0-16) ...
vagrant@vm:~$ ps -ef | grep ntp
ntp       2338     1  0 22:14 ?        00:00:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 109:114
vagrant   2352  1751  0 22:14 pts/4    00:00:00 grep --color=auto ntp
vagrant@vm:~$ ls /etc/init.d/ntp 
/etc/init.d/ntp
vagrant@vm:~$ service ntp status
 * NTP server is running
vagrant@vm:~$ initctl status ntp
initctl: Unknown job: ntp

@chris-rock
Copy link
Contributor

Problem confirmed. This happens to all services located in /etc/init.d. Those services are loaded by upstart, but are not shown in their tooling. On Ubuntu pre 15.04 we need to combine Upstart with SystemV service implementation.

@zmalone
Copy link
Contributor Author

zmalone commented Nov 12, 2015

#228 appears to fix this. Thank you!

@arlimus
Copy link
Contributor

arlimus commented Nov 13, 2015

Should be fixed by #228 . Please reopen if the issue still persists.
Thank you @zmalone for reporting!

@arlimus arlimus closed this as completed Nov 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants