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.running not working #1506

Closed
benmathews opened this issue Jun 26, 2012 · 10 comments
Closed

service.running not working #1506

benmathews opened this issue Jun 26, 2012 · 10 comments
Milestone

Comments

@benmathews
Copy link

I’ve got a a sls file as follows

include:
  - localrepos

activemq:
  pkg:
    - installed
    - require:
      - file: /etc/yum.repos.d/unionstation.repo
  service:
    - running

In other states I've written, the running state seems to be working, but in this case it doesn’t start the service.
[root@esb1 ~]# salt-call state.highstate -l trace

[INFO ] Executing state service.running for activemq
[INFO ] Executing command /sbin/service activemq status in directory /root
[INFO ] No changes made for activemq

[root@esb1 ~]# /sbin/service activemq status
ActiveMQ Broker is not running.
[root@esb1 ~]# ps -ef |grep active
root 27928 3069 0 15:25 pts/0 00:00:00 grep active

[root@salt ~]# salt-master --version
salt-master 0.9.9.1

[root@esb1 ~]# salt-minion --version
salt-minion 0.10.1

@thatch45
Copy link
Member

what distribution are you running?

@benmathews
Copy link
Author

[root@esb1 ~]# uname -a
Linux esb1 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010
x86_64 x86_64 x86_64 GNU/Linux
[root@esb1 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.0 (Santiago)

On Tue, Jun 26, 2012 at 5:05 PM, Thomas S Hatch
reply@reply.github.com
wrote:

what distribution are you running?


Reply to this email directly or view it on GitHub:
#1506 (comment)

Ben Mathews

@thatch45
Copy link
Member

thanks, I will take a look

@thekuffs
Copy link

@benmathews what return code does /sbin/service activemq status give you? I found that some chkconfig scripts don't try very hard to make sure that they return the right values.

@benmathews
Copy link
Author

[root@esb1 ~]# /sbin/service activemq status
ActiveMQ Broker is not running.
[root@esb1 ~]# /sbin/service activemq start
Starting ActiveMQ Broker...
[root@esb1 ~]# /sbin/service activemq status
ActiveMQ Broker is running (9720).

On Mon, Jul 16, 2012 at 4:47 PM, Aaron Tygart
reply@reply.github.com
wrote:

@benmathews what return code does /sbin/service activemq status give you? I found that some chkconfig scripts don't try very hard to make sure that they return the right values.


Reply to this email directly or view it on GitHub:
#1506 (comment)

Ben Mathews

@thekuffs
Copy link

@benmathews can you do echo $? after each one of those commands, please?

@benmathews
Copy link
Author

[root@esb1 ~]# /sbin/service activemq stop
Stopping ActiveMQ Broker...
Stopped ActiveMQ Broker.
[root@esb1 ~]# echo $?
0
[root@esb1 ~]# /sbin/service activemq status
ActiveMQ Broker is not running.
[root@esb1 ~]# echo $?
0
[root@esb1 ~]# /sbin/service activemq start
Starting ActiveMQ Broker...
[root@esb1 ~]# echo $?
0
[root@esb1 ~]# /sbin/service activemq status
ActiveMQ Broker is running (10485).
[root@esb1 ~]# echo $?
0

On Tue, Jul 17, 2012 at 12:09 PM, Aaron Tygart
reply@reply.github.com
wrote:

@benmathews can you do echo $? after each one of those commands, please?


Reply to this email directly or view it on GitHub:
#1506 (comment)

Ben Mathews

@thekuffs
Copy link

The problem is with the init script, not with the service.running state. The init script needs to return a nonzero exit code on service activemq status when ActiveMQ is indeed not running.

@benmathews
Copy link
Author

Thanks for walking me through this. For anyone else that comes across this, I've filed a defect against activemq at https://issues.apache.org/jira/browse/AMQ-3936

@thekuffs
Copy link

No problem at all. I recently had to do similar debugging on other init scripts :)

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