Systemd: How to stop an enabled process if the user start the same application

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












If process is enabled to start on boot, in this specific case it's a headless qlcplus lighting controller. Is there a way to stop that process if a user later logs in and manually start the full qlcplus GUI application in order to edit the controller file?



I could write a script that disables the systemd process, before starting the qlcplus gui but I'd need to re-enable the systemd process when the GUI exits. I should mention that this system is to be used by lighting technicians (unfamiliar with linux) not computer tech's, so no typing into a CL terminal is allowed.



I could also have a ~/.config/autostart/qlcplus.desktop, I was just curious if there's a systemd way of doing this and|or ensure there's only ever a single instance running.



This is to unsure that the lighting is always controlled even after unattended|unscheduled reboots. Running 2 DMX controller threads is obviously a "bad thing".



System is a raspberry pi with raspbian-stretch.







share|improve this question




















  • could you just add a wrapper script to the user application start to determine if the systemd started task is running and if yes then use the running process instead of killing it or launching a dupe ... this is a pattern I use in similar use cases
    – Scott Stensland
    Feb 17 at 19:20











  • Would the web interface be sufficient for your techs to use? If so, you wouldn't have to touch the running service at all, and only require a browser on the client.
    – ErikF
    Feb 18 at 10:32














up vote
1
down vote

favorite












If process is enabled to start on boot, in this specific case it's a headless qlcplus lighting controller. Is there a way to stop that process if a user later logs in and manually start the full qlcplus GUI application in order to edit the controller file?



I could write a script that disables the systemd process, before starting the qlcplus gui but I'd need to re-enable the systemd process when the GUI exits. I should mention that this system is to be used by lighting technicians (unfamiliar with linux) not computer tech's, so no typing into a CL terminal is allowed.



I could also have a ~/.config/autostart/qlcplus.desktop, I was just curious if there's a systemd way of doing this and|or ensure there's only ever a single instance running.



This is to unsure that the lighting is always controlled even after unattended|unscheduled reboots. Running 2 DMX controller threads is obviously a "bad thing".



System is a raspberry pi with raspbian-stretch.







share|improve this question




















  • could you just add a wrapper script to the user application start to determine if the systemd started task is running and if yes then use the running process instead of killing it or launching a dupe ... this is a pattern I use in similar use cases
    – Scott Stensland
    Feb 17 at 19:20











  • Would the web interface be sufficient for your techs to use? If so, you wouldn't have to touch the running service at all, and only require a browser on the client.
    – ErikF
    Feb 18 at 10:32












up vote
1
down vote

favorite









up vote
1
down vote

favorite











If process is enabled to start on boot, in this specific case it's a headless qlcplus lighting controller. Is there a way to stop that process if a user later logs in and manually start the full qlcplus GUI application in order to edit the controller file?



I could write a script that disables the systemd process, before starting the qlcplus gui but I'd need to re-enable the systemd process when the GUI exits. I should mention that this system is to be used by lighting technicians (unfamiliar with linux) not computer tech's, so no typing into a CL terminal is allowed.



I could also have a ~/.config/autostart/qlcplus.desktop, I was just curious if there's a systemd way of doing this and|or ensure there's only ever a single instance running.



This is to unsure that the lighting is always controlled even after unattended|unscheduled reboots. Running 2 DMX controller threads is obviously a "bad thing".



System is a raspberry pi with raspbian-stretch.







share|improve this question












If process is enabled to start on boot, in this specific case it's a headless qlcplus lighting controller. Is there a way to stop that process if a user later logs in and manually start the full qlcplus GUI application in order to edit the controller file?



I could write a script that disables the systemd process, before starting the qlcplus gui but I'd need to re-enable the systemd process when the GUI exits. I should mention that this system is to be used by lighting technicians (unfamiliar with linux) not computer tech's, so no typing into a CL terminal is allowed.



I could also have a ~/.config/autostart/qlcplus.desktop, I was just curious if there's a systemd way of doing this and|or ensure there's only ever a single instance running.



This is to unsure that the lighting is always controlled even after unattended|unscheduled reboots. Running 2 DMX controller threads is obviously a "bad thing".



System is a raspberry pi with raspbian-stretch.









share|improve this question











share|improve this question




share|improve this question










asked Feb 17 at 19:15









Mike Evans

61




61











  • could you just add a wrapper script to the user application start to determine if the systemd started task is running and if yes then use the running process instead of killing it or launching a dupe ... this is a pattern I use in similar use cases
    – Scott Stensland
    Feb 17 at 19:20











  • Would the web interface be sufficient for your techs to use? If so, you wouldn't have to touch the running service at all, and only require a browser on the client.
    – ErikF
    Feb 18 at 10:32
















  • could you just add a wrapper script to the user application start to determine if the systemd started task is running and if yes then use the running process instead of killing it or launching a dupe ... this is a pattern I use in similar use cases
    – Scott Stensland
    Feb 17 at 19:20











  • Would the web interface be sufficient for your techs to use? If so, you wouldn't have to touch the running service at all, and only require a browser on the client.
    – ErikF
    Feb 18 at 10:32















could you just add a wrapper script to the user application start to determine if the systemd started task is running and if yes then use the running process instead of killing it or launching a dupe ... this is a pattern I use in similar use cases
– Scott Stensland
Feb 17 at 19:20





could you just add a wrapper script to the user application start to determine if the systemd started task is running and if yes then use the running process instead of killing it or launching a dupe ... this is a pattern I use in similar use cases
– Scott Stensland
Feb 17 at 19:20













Would the web interface be sufficient for your techs to use? If so, you wouldn't have to touch the running service at all, and only require a browser on the client.
– ErikF
Feb 18 at 10:32




Would the web interface be sufficient for your techs to use? If so, you wouldn't have to touch the running service at all, and only require a browser on the client.
– ErikF
Feb 18 at 10:32















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424849%2fsystemd-how-to-stop-an-enabled-process-if-the-user-start-the-same-application%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424849%2fsystemd-how-to-stop-an-enabled-process-if-the-user-start-the-same-application%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?