On Tue, Jun 19, 2018 at 6:50 AM Josef Reidinger
On Tue, 19 Jun 2018 12:20:59 +0200 John Paul Adrian Glaubitz
wrote: On 06/19/2018 12:17 PM, Simon Lees wrote:
I'm not sure how checking if the old service was started / enabled before starting / enabling the new services will cause your package to be unusable by your target audience, you have already stated that they will all have the old service started and enabled.
Can you please explain me how I am supposed to test whether the google-network-daemon service is already running when upgrading from a version which does not include the google-network-daemon service?
Thanks, Adrian
I expect to see code like you have there:
if [ -f /usr/lib/systemd/system/google-ip-forwarding-daemon.service ]; then systemctl stop --no-block google-ip-forwarding-daemon systemctl disable google-ip-forwarding-daemon.service FROM_OLD=1 fi if [ -f /usr/lib/systemd/system/google-network-setup.service ]; then systemctl stop --no-block google-network-setup systemctl disable google-network-setup.service FROM_OLD=${FROM_OLD}1 fi if [ "$FROM_OLD" == "11" ] then systemctl enable google-network-daemon.service systemctl start google-network-daemon.service fi
I'd go one step further and say that you should check if it's enabled: if systemctl -q is-enabled google-ip-forwarding-daemon.service; then if systemctl -q is-active google-ip-forwarding-daemon.service; then FROM_OLD_ACTIVE=1 fi systemctl stop --no-block google-ip-forwarding-daemon systemctl disable google-ip-forwarding-daemon.service FROM_OLD=1 fi if systemctl -q is-enabled google-network-setup.service; then if systemctl -q is-active google-network-setup.service; then FROM_OLD_ACTIVE=${FROM_OLD_ACTIVE}1 fi systemctl stop --no-block google-network-setup systemctl disable google-network-setup.service FROM_OLD=${FROM_OLD}1 fi if [ "$FROM_OLD" == "11" ]; then systemctl enable google-network-daemon.service if [ "$FROM_OLD_ACTIVE" == "11" ]; then systemctl start google-network-daemon.service fi fi -- 真実はいつも一つ!/ Always, there's only one truth! -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org