Project

General

Profile

Actions

Bug #2854

closed

Service started at boot check fails on Red Hat

Added by Ade Bradshaw about 12 years ago. Updated over 9 years ago.

Status:
Released
Priority:
1 (highest)
Assignee:
Jonathan CLARKE
Category:
Techniques
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

On a RHEL 6 system, the option to check that a service is started at boot fails and I can see this in the log

Aug 29 13:21:24 host107 rudder[19865]:  Q: ".../chkconfig --ch": --check: unknown option
Aug 29 13:21:24 host107 rudder[19865]: I: Last 1 quoted lines were generated by promis er "/sbin/chkconfig --check ntpd"
Aug 29 13:21:24 host107 rudder[19865]: Proposed executable file "/sbin/insserv" doesn' t exist
Aug 29 13:21:24 host107 rudder[19865]: R: @ServicesManagement@result_error@f655821d-350e-4e64-ba09-98517321ed0c@510b7fea-a2da-43aa-8236-2313edc2f96b@2@Process@ntpd@2 012-08-29 13:21:21+01:00##21cb75f7-9212-417b-a5f5-dbf3abf74987@#Cannot check the status of ntpd: the process name is not filed
Aug 29 13:21:24 host107 rudder19865: R: @ServicesManagement@result_success@f65582 1d-350e-4e64-ba09-98517321ed0c@510b7fea-a2da-43aa-8236-2313edc2f96b@2@Advanced optio ns@ntpd@2012-08-29 13:21:21+01:00##21cb75f7-9212-417b-a5f5-dbf3abf74987@#The process range is not to be checked for service ntpd

I guess the issue is that, in RHEL, chkconfig doesnt have a --check option

SYNOPSIS
chkconfig [--list] [--type type][name]
chkconfig --add name
chkconfig --del name
chkconfig --override name
chkconfig [--level levels] [--type type] name <on|off|reset|reset-priorities>
chkconfig [--level levels] [--type type] name

Files

servicesManagement-1.2.tgz (3.79 KB) servicesManagement-1.2.tgz Jonathan CLARKE, 2012-08-31 18:19
Actions #1

Updated by Ade Bradshaw about 12 years ago

I should say that in RHEL,Centos, Oracle linux, Fedora - chkconfig doesnt have a --check option

Actions #2

Updated by Ade Bradshaw about 12 years ago

Looks like the same functionality is available in rhel/centos/oracle by just missing the --check out

From the man page for chkconfig on rhel6

When chkconfig is run with only a service name, it checks to see if the
service is configured to be started in the current runlevel. If it is,
chkconfig returns true; otherwise it returns false. The --level option
may be used to have chkconfig query an alternative runlevel rather than
the current one.

Hope that helps

Actions #3

Updated by François ARMAND about 12 years ago

  • Status changed from New to 8
  • Priority changed from N/A to 1 (highest)

This is blocking because it basically means that most techniques using service won't work on RedHat.

Actions #4

Updated by Jonathan CLARKE about 12 years ago

  • Status changed from 8 to In progress
  • Assignee set to Jonathan CLARKE
  • Target version changed from 2.4.0~rc1 to 2.3.9

I'm testing a fix for this at the moment. I'll commit later today.

Actions #5

Updated by Jonathan CLARKE about 12 years ago

  • Status changed from In progress to Discussion
  • Assignee changed from Jonathan CLARKE to Ade Bradshaw

This part of the Technique (check service on boot) didn't work at all on RHEL/CentOS systems...

Attached is a new version 1.2 of the Technique that should fix all problems on CentOS (and makes the Technique a lot DRY-er :) ). Ade, could you test this?

To install it, follow these steps:
  1. On your Rudder server, cd /var/rudder/configuration-repository/techniques/systemSettings/process/servicesManagement
  2. tar xvzf servicesManagement-1.2.tgz (attached file)
  3. git add 1.2
  4. git commit -m "Adding version 1.2 of servicesManagement Technique to test"
  5. Go into the Rudder web UI, to the Administration > Policy Server" screen and click on the "Reload" button under "Reload Techniques"
  6. Find your Directive based on this Technique, and select "1.2" in the menu at the very top of the screen that says "Migrate Directive to Technique version:" then click Migrate

From then on, it should just work.

Actions #6

Updated by Jonathan CLARKE about 12 years ago

Aaaand the file.

Actions #7

Updated by Ade Bradshaw about 12 years ago

Hi

I unzipped the file provided (and did a chown so that the ownership matched that of 1.1 and 1.2) but even after I reloaded the techniques, I cant see 1.2 in the drop down menu of the Directive

Actions #8

Updated by Jonathan CLARKE about 12 years ago

Ade Bradshaw wrote:

I unzipped the file provided (and did a chown so that the ownership matched that of 1.1 and 1.2) but even after I reloaded the techniques, I cant see 1.2 in the drop down menu of the Directive

That's weird. Can you confirm that:

  1. You did do the git add and git commit steps in my instructions above?
  2. The Directive in question is using the "service management" Technique, and not another one?
Actions #9

Updated by Ade Bradshaw about 12 years ago

Ok, just did a fresh install and followed the instructions again - except I added a chown into it as the new 1.2 directory was owned by uid 1000 when unzipped

Here is the entire output

Everything has been set up correctly.
Rudder is ready to go on http://rudder.example.org/
[root@rudder ~]# cd /var/rudder/configuration-repository/techniques/systemSettings/process/servicesManagement
[root@rudder servicesManagement]# ls l
total 8
drwxr-xr-x. 2 root root 4096 Sep 2 13:23 1.0
drwxr-xr-x. 2 root root 4096 Sep 2 13:23 1.1
[root@rudder servicesManagement]# wget http://www.rudder-project.org/redmine/attachments/513/servicesManagement-1.2.tgz
--2012-09-02 13:30:09-
http://www.rudder-project.org/redmine/attachments/513/servicesManagement-1.2.tgz
Resolving www.rudder-project.org... 88.190.225.229
Connecting to www.rudder-project.org|88.190.225.229|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3876 (3.8K) [application/x-compressed-tar]
Saving to: `servicesManagement-1.2.tgz'

100%[============================================>] 3,876 --.-K/s in 0.03s

2012-09-02 13:30:10 (129 KB/s) - `servicesManagement-1.2.tgz' saved [3876/3876]

[root@rudder servicesManagement]# tar tf servicesManagement-1.2.tgz
1.2/
1.2/policy.xml
1.2/changelog
1.2/servicesManagement.st
[root@rudder servicesManagement]# tar xvf servicesManagement-1.2.tgz
1.2/
1.2/policy.xml
1.2/changelog
1.2/servicesManagement.st
[root@rudder servicesManagement]# ll
total 16
drwxr-xr-x. 2 root root 4096 Sep 2 13:23 1.0
drwxr-xr-x. 2 root root 4096 Sep 2 13:23 1.1
drwxr-xr-x. 2 1000 1000 4096 Aug 31 17:14 1.2
rw-r--r-. 1 root root 3876 Sep 2 13:30 servicesManagement-1.2.tgz
[root@rudder servicesManagement]# chown r root.root 1.2
chown: invalid option -
'r'
Try `chown --help' for more information.
[root@rudder servicesManagement]# chown R root.root 1.2
[root@rudder servicesManagement]# ll
total 16
drwxr-xr-x. 2 root root 4096 Sep 2 13:23 1.0
drwxr-xr-x. 2 root root 4096 Sep 2 13:23 1.1
drwxr-xr-x. 2 root root 4096 Aug 31 17:14 1.2
-rw-r--r-
. 1 root root 3876 Sep 2 13:30 servicesManagement-1.2.tgz
[root@rudder servicesManagement]# vgs
VG #PV #LV #SN Attr VSize VFree
myvg 1 1 0 wz--n- 8.81g 0
[root@rudder servicesManagement]# git add 1.2
[root@rudder servicesManagement]# git commit -m "Adding version 1.2 of servicesManagement Technique to test"
[master 896c8ec] Adding version 1.2 of servicesManagement Technique to test
Committer: root <>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

git config --global user.name "Your Name" 
git config --global user.email

If the identity used for this commit is wrong, you can fix it with:

git commit --amend --author='Your Name &lt;&gt;'
3 files changed, 403 insertions(+), 0 deletions(-)
create mode 100644 techniques/systemSettings/process/servicesManagement/1.2/changelog
create mode 100644 techniques/systemSettings/process/servicesManagement/1.2/policy.xml
create mode 100644 techniques/systemSettings/process/servicesManagement/1.2/servicesManagement.st
Actions #10

Updated by Ade Bradshaw about 12 years ago

hmm I should have used inline code I guess -

Everything has been set up correctly.
Rudder is ready to go on http://rudder.example.org/
[root@rudder ~]# cd /var/rudder/configuration-repository/techniques/systemSettings/process/servicesManagement
[root@rudder servicesManagement]# ls -l
total 8
drwxr-xr-x. 2 root root 4096 Sep  2 13:23 1.0
drwxr-xr-x. 2 root root 4096 Sep  2 13:23 1.1
[root@rudder servicesManagement]# wget http://www.rudder-project.org/redmine/attachments/513/servicesManagement-1.2.tgz
--2012-09-02 13:30:09--  http://www.rudder-project.org/redmine/attachments/513/servicesManagement-1.2.tgz
Resolving www.rudder-project.org... 88.190.225.229
Connecting to www.rudder-project.org|88.190.225.229|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3876 (3.8K) [application/x-compressed-tar]
Saving to: `servicesManagement-1.2.tgz'

100%[============================================>] 3,876       --.-K/s   in 0.03s

2012-09-02 13:30:10 (129 KB/s) - `servicesManagement-1.2.tgz' saved [3876/3876]

[root@rudder servicesManagement]# tar tf servicesManagement-1.2.tgz
1.2/
1.2/policy.xml
1.2/changelog
1.2/servicesManagement.st
[root@rudder servicesManagement]# tar xvf servicesManagement-1.2.tgz
1.2/
1.2/policy.xml
1.2/changelog
1.2/servicesManagement.st
[root@rudder servicesManagement]# ll
total 16
drwxr-xr-x. 2 root root 4096 Sep  2 13:23 1.0
drwxr-xr-x. 2 root root 4096 Sep  2 13:23 1.1
drwxr-xr-x. 2 1000 1000 4096 Aug 31 17:14 1.2
-rw-r--r--. 1 root root 3876 Sep  2 13:30 servicesManagement-1.2.tgz
[root@rudder servicesManagement]# chown -r root.root 1.2
chown: invalid option -- 'r'
Try `chown --help' for more information.
[root@rudder servicesManagement]# chown -R root.root 1.2
[root@rudder servicesManagement]# ll
total 16
drwxr-xr-x. 2 root root 4096 Sep  2 13:23 1.0
drwxr-xr-x. 2 root root 4096 Sep  2 13:23 1.1
drwxr-xr-x. 2 root root 4096 Aug 31 17:14 1.2
-rw-r--r--. 1 root root 3876 Sep  2 13:30 servicesManagement-1.2.tgz
[root@rudder servicesManagement]# vgs
  VG   #PV #LV #SN Attr   VSize VFree
  myvg   1   1   0 wz--n- 8.81g    0
[root@rudder servicesManagement]# git add 1.2
[root@rudder servicesManagement]# git commit -m "Adding version 1.2 of servicesManagement Technique to test" 
[master 896c8ec] Adding version 1.2 of servicesManagement Technique to test
 Committer: root <root@rudder.example.org>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name" 
    git config --global user.email you@example.com

If the identity used for this commit is wrong, you can fix it with:

    git commit --amend --author='Your Name <you@example.com>'

 3 files changed, 403 insertions(+), 0 deletions(-)
 create mode 100644 techniques/systemSettings/process/servicesManagement/1.2/changelog
 create mode 100644 techniques/systemSettings/process/servicesManagement/1.2/policy.xml
 create mode 100644 techniques/systemSettings/process/servicesManagement/1.2/servicesManagement.st
Actions #11

Updated by Jonathan CLARKE about 12 years ago

Thanks for that info. Sorry I didn't reply earlier, I hadn't seen your response... /me slaps forehead.

This does indeed look exactly like the procedure I described... I'm confused as to why this isn't appearing in the web interface.

Could you check the logs of the application for any errors after clicking on "Reload" in the Configuration Management > Techniques page? The log could be in /var/log/rudder/core/rudder-webapp.log or /var/log/rudder/webapp/2012_09_04.stderrout.log (change the filename to match the current day, obviously).

Last but not least, could you go to the Directives screen, and select the "Services management" directive, and check the contents of the "Versions available" box on the right?

Thanks!

Actions #12

Updated by Jonathan CLARKE about 12 years ago

  • Status changed from Discussion to Pending technical review
  • % Done changed from 0 to 100

Applied in changeset commit:c9a5c9fdc7859c60681ec2d178f5881051156788.

Actions #13

Updated by Jonathan CLARKE about 12 years ago

I haven't heard back from Ade yet, but I've commited this new version 1.2 in GitHub anyway. It works on my test machines, please shout if it's not OK for you!

Actions #14

Updated by Jonathan CLARKE about 12 years ago

  • Assignee changed from Ade Bradshaw to Jonathan CLARKE
Actions #15

Updated by Nicolas CHARLES about 12 years ago

  • Status changed from Pending technical review to Released

This looks good, thank you Jonathan for the correction, and Ade for the bug report

Actions #16

Updated by Benoît PECCATTE over 9 years ago

  • Project changed from 24 to Rudder
  • Category changed from Techniques to Techniques
Actions

Also available in: Atom PDF