try to keep old daemon running if new start failed (#267)

This commit is contained in:
Zhang Jingqiang 2024-07-16 18:06:40 +08:00 committed by GitHub
parent 5bffc814d2
commit 51ff7ec2bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
54 changed files with 1252 additions and 290 deletions

View file

@ -8,7 +8,7 @@ Type=simple
Environment="RUNTIME_DIRECTORY=/run/g3proxy"
EnvironmentFile=-/etc/g3proxy/%i/env
ExecStartPre=/bin/sh -c "[ -d $RUNTIME_DIRECTORY ] || mkdir $RUNTIME_DIRECTORY"
ExecStartPre=/bin/sh -c "[ ! -e $RUNTIME_DIRECTORY/%i.sock ] || rm $RUNTIME_DIRECTORY/%i.sock"
ExecStartPre=-/usr/bin/g3proxy-ctl --control-dir $RUNTIME_DIRECTORY -G %i offline
ExecStart=/usr/bin/g3proxy -c /etc/g3proxy/%i/ --control-dir $RUNTIME_DIRECTORY -s -G %i
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/usr/bin/g3proxy-ctl --control-dir $RUNTIME_DIRECTORY -G %i -p $MAINPID offline