Merge lp:~cjwatson/turku/turku-agent-fix-rsyncd-interaction into lp:turku/turku-agent

Proposed by Colin Watson
Status: Merged
Approved by: Haw Loeung
Approved revision: 51
Merged at revision: 50
Proposed branch: lp:~cjwatson/turku/turku-agent-fix-rsyncd-interaction
Merge into: lp:turku/turku-agent
Diff against target: 41 lines (+8/-6)
2 files modified
turku-agent-rsyncd.init-debian (+1/-1)
turku_agent/update_config.py (+7/-5)
To merge this branch: bzr merge lp:~cjwatson/turku/turku-agent-fix-rsyncd-interaction
Reviewer Review Type Date Requested Status
Haw Loeung Approve
Review via email: mp+367418@code.launchpad.net

Commit message

Don't restart rsyncd when updating its configuration.

Description of the change

This should fix problems where running backups are interrupted.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Work in progress for now as apparently this start-unless-running strategy fails on upstart.

Revision history for this message
Junien F (axino) wrote :

Not good enough on trusty :

$ sudo service turku-agent-rsyncd start
start: Job is already running: turku-agent-rsyncd
$ echo $?
1

Revision history for this message
Colin Watson (cjwatson) wrote :

I guess we maybe want something like the service_running strategy in charmhelpers for the upstart case?

Revision history for this message
Haw Loeung (hloeung) wrote :

LGTM, +1

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 50

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'turku-agent-rsyncd.init-debian'
--- turku-agent-rsyncd.init-debian 2015-04-14 05:44:07 +0000
+++ turku-agent-rsyncd.init-debian 2019-05-14 15:06:23 +0000
@@ -23,7 +23,7 @@
23 start)23 start)
24 log_daemon_msg "Starting turku rsync daemon" "turku-agent-rsyncd"24 log_daemon_msg "Starting turku rsync daemon" "turku-agent-rsyncd"
25 start-stop-daemon --start --quiet --background --make-pidfile \25 start-stop-daemon --start --quiet --background --make-pidfile \
26 --pidfile $PID_FILE --exec /usr/bin/env -- turku-agent-rsyncd-wrapper26 --pidfile $PID_FILE --startas /usr/bin/env -- turku-agent-rsyncd-wrapper
27 log_end_msg $?27 log_end_msg $?
28 ;;28 ;;
29 stop)29 stop)
3030
=== modified file 'turku_agent/update_config.py'
--- turku_agent/update_config.py 2019-04-22 01:19:36 +0000
+++ turku_agent/update_config.py 2019-05-14 15:06:23 +0000
@@ -89,10 +89,12 @@
89 f.write(built_rsyncd_secrets)89 f.write(built_rsyncd_secrets)
9090
9191
92def restart_services():92def start_services():
93 # Restart rsyncd93 # Start rsyncd if it isn't already running.
94 if not subprocess.call(['service', 'turku-agent-rsyncd', 'restart']) == 0:94 # Note that we do *not* need to reload rsyncd when changing rsyncd.conf,
95 subprocess.check_call(['service', 'turku-agent-rsyncd', 'start'])95 # as it rereads it on every client connection; but we may need to start
96 # it as it won't start if its configuration file doesn't exist.
97 subprocess.check_call(['service', 'turku-agent-rsyncd', 'start'])
9698
9799
98def send_config(config):100def send_config(config):
@@ -153,6 +155,6 @@
153 raise155 raise
154 logging.exception(e)156 logging.exception(e)
155 return 1157 return 1
156 restart_services()158 start_services()
157159
158 lock.close()160 lock.close()

Subscribers

People subscribed via source and target branches

to all changes: