From 87c693c7bdf0d2207366096f82281dc18a0c0f1a Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 7 Jan 2019 10:24:27 +0100 Subject: [PATCH] blinkd: Use system python This is the second part of the blinkd fix (issue #54). PR #64 prevented the deadlock during service start. However, currently blinkd is not starting at system boot, because it uses `env python3` in the shebang. This will activate our default (big, scientific) python3 which is located in /pkg and depends on the automounter. One solution to this problem would be to add After=automount.service to blinkd.service. This would delay the startup of blinkd to the point, when automounter has finished startup. However, experiments showed, that this doesn't work. It looks like the startup command of automount.service exists after daemon process has been forked but before the automount paths have been mounted. So systemd regards automount.service has started before the automount paths are really available and services with After=automount.service are still started to early to use them. That aside, although /usr/bin/python3 depends on /pkg, it is not supposed to go via NFS under normal circumstances, because of the local mechanism on mxpkg. However, under exceptional circumstances (e.g. transition to a new python3 version) it might go over NFS and we don't want long-running deamons to lock nfs mounts. A python3 with the blink1 package from PyPi has been added to the system [1] and is available as /usr/local/system/python3/bin/python3. This python installation is guaranteed to be on a local disk, so use this path in the shebang. [1] https://github.molgen.mpg.de/mariux64/pkg-scripts/commit/8e149c1fd114e75479dae3338711891e04b0e6fa --- blink/blinkd.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/blink/blinkd.py b/blink/blinkd.py index 6df6bd3b..a4fa731d 100755 --- a/blink/blinkd.py +++ b/blink/blinkd.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python3 - +#! /usr/local/system/python3/bin/python3 from blink1.blink1 import Blink1, Blink1ConnectionFailed from multiprocessing import cpu_count