Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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).
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.