Tux's lil' helper
Joined: 09 Sep 2010
|Posted: Sun Jan 10, 2016 2:01 pm Post subject: Prevent retstarting services closed by NetworkManager
on my notebook I use NetworkManager and have two connections called "Internet" and "Samba". Via a dispatcher-script "Samba" starts the samba-service while "Internet" starts the tor- and the ntpd-service. Additionally the services are stopped if the related connection is lost or closed.
This worked great but now it is broken.
I made some tests and saw that now the services are stopped if all connections are lost or closed before my dispatcher script runs. The problem is then that the automatically stopped services restart if any connection comes up again. This leads to situations where the sumba-service runs with "Internet" and so on.
Deleting the "need net" line from the init-scripts of the services (samba ...) solved the problem and now it works again but I think that this is more a workaround then a solution.
To summarize: Have anyone out here a clue how to prevent the reactivation of services which were automatically stopped while NetworkManager lost its connections?