LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-28-2019, 10:02 AM   #31
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063

If it's being run via your service, you'd simply stop/restart your service that's running it with systemctl.

If you were running it directly, you could press CTRL+C (without the plus sign).
 
Old 02-28-2019, 10:21 AM   #32
NikkyG
LQ Newbie
 
Registered: Feb 2019
Posts: 18

Original Poster
Rep: Reputation: Disabled
Quote:
If it's being run via your service, you'd simply stop/restart your service that's running it with systemctl.
I thought that even though the service was the one that started it, since the loop is infinite, stopping the service would not have any impact. I'll try that.
Thanks.

EDIT: stopping the service does make the script to stop. However, when modifying the script and restarting the service, changes are not taken into account (looks like it keeps a memory of the script before modification).

Last edited by NikkyG; 02-28-2019 at 01:50 PM.
 
Old 03-01-2019, 11:28 AM   #33
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Sorry NikkyG, I would have assumed the same thing myself, it seems that it's not the case (maybe because it's a script rather than an executable?).

While I haven't tested it myself, from my reading, you could try adding the "KillMode=" option to your service file. So it looks something like the following;

Code:
KillMode=process
From my understanding the above means, when you stop the service, the process the service starts will be killed - hence that option's name.

You can read more about it in the link below.

https://www.freedesktop.org/software...emd.kill.html#
 
1 members found this post helpful.
Old 03-02-2019, 11:03 AM   #34
NikkyG
LQ Newbie
 
Registered: Feb 2019
Posts: 18

Original Poster
Rep: Reputation: Disabled
Thank you. I'll look into that.
I will close this thread. You've been both very helpful, thanks a lot again.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Story Behind ‘init’ and ‘systemd’: Why ‘init’ Needed to be Replaced with ‘systemd’ in Linu LXer Syndicated Linux News 1 04-07-2017 11:33 PM
Can't access full journalctl from script via systemd service even though user is in systemd-journal group iwtbf Linux - Newbie 0 02-19-2016 02:44 PM
LXer: Why pro-systemd and anti-systemd people will never get along LXer Syndicated Linux News 0 05-15-2015 11:44 PM
LXer: Is systemd as bad as boycott systemd is trying to make it? LXer Syndicated Linux News 0 09-03-2014 05:50 PM
Boot Delay 30min: systemd-analyze blame systemd-tmpfiles-setup.service BGHolmes Fedora 0 07-27-2011 09:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration