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

2 waagent deamon processes exist after rpm -U #404

Closed
yuxisun1217 opened this issue Sep 1, 2016 · 5 comments
Closed

2 waagent deamon processes exist after rpm -U #404

yuxisun1217 opened this issue Sep 1, 2016 · 5 comments
Assignees
Labels
Milestone

Comments

@yuxisun1217
Copy link

Hi,

I make a WALinuxAgent-2.1.5 package follow the rpm/README, and then use rpm -U to upgrade from 2.0.16 to 2.1.5 on RHEL-6.8. After that, there's 2 waagent -daemon processes.

Steps:

  1. Prepare a VM(RHEL-6.8) with WALinuxAgent-2.0.16 installed, and service started.
  2. Make a WALinuxAgent-2.1.5 rpm package follow the rpm/README.
  3. run "rpm -U WALinuxAgent-2.1.5-1.noarch.rpm".
  4. Check waagent -deamon process. Run "ps aux|grep waagent"
    [root@localhost ~]# ps aux|grep waagent
    root 2158 5.0 1.0 197388 10808 pts/2 S 10:04 0:00 python /usr/sbin/waagent -daemon
    root 2184 5.0 1.0 197384 10804 pts/2 S 10:04 0:00 python /usr/sbin/waagent -daemon

I made a new spec file, added "service waagent stop" in the %pre phase, to prevent this. (Hans helped to review that spec file). But it's only a workaround. And we read some spec files of other services(such as sshd, squid and so on), all of them there's no "service stop" in the %pre phase. So we still try to find some resolutions in the regular way(I mean if there's no %pre phase, there also shouldn't be 2 processes). Do you have some ideas about this issue? Thanks!

@brendandixon brendandixon added this to the v2.1.7 milestone Sep 1, 2016
@brendandixon
Copy link
Contributor

@yuxisun1217 Good catch. We'll change the agent code to stop all prior versions before starting the new version.

@hglkrijger
Copy link
Member

@yuxisun1217 I have pushed a fix to make sure we stop any running services before starting, which should prevent this. However, I think even without this fix, running another service start should result in no action if another exists. Perhaps the sysv script should also be checking pid to see if the process is already running, since the user may decide to call service start multiple times.

@yuxisun1217
Copy link
Author

yuxisun1217 commented Sep 5, 2016

@hglkrijger Yes, I quite agree with you. It's very nice if we can use sysv script to make sure there's only 1 process. Just personal suggestion: perhaps we can use both /var/run/waagent.pid and /var/lock/subsys/waagent to control it?

@yuxisun1217
Copy link
Author

yuxisun1217 commented Sep 5, 2016

Hi @hglkrijger , may I suggest to add the "condrestart|try-restart" into the sysv script? It seems that many services run "service condrestart" in their spec files. Now we don't have this command so we have use "service restart" instead.
The "condrestart" is equivalent to "systemctl try-restart" in RHEL-7, which means "Restart one or more units specified on the command line if the units are running. This does nothing if units are not running."

@hglkrijger
Copy link
Member

sounds good, thanks @yuxisun1217 - closing this issue as the restart code is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants