Overclockers Australia Forums

OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Software Topics > Other Operating Systems

Notices


Sign up for a free OCAU account and this ad will go away!
Search our forums with Google:
Reply
 
Thread Tools
Old 14th June 2017, 11:00 AM   #1
Primüs Thread Starter
Member
 
Primüs's Avatar
 
Join Date: Oct 2005
Location: Coffs Harbour, NSW
Posts: 3,260
Default systemd - spawning other processes

Hi Guys,

Writing a systemd startup script. Its basically to do some special checks before starting mysql (with certain flags based on the check).

This is all on ubuntu 16.04

Ultimately its just a bash script that checks a few conditions and then either calls

/etc/init.d/mysql start --some-args

or

/etc/init.d/mysql start --other-args


The script works fine being invoked by root on CLI.

Once pushing it to a systemd mysql-check.service, it still seems to run OK, but systemd is starting the mysql process and then appears to kill it when the script ends (ending 0/SUCCESS), how do I spawn those processes from the systemd script so they continue to run outside of the initial bash script when run inside systemd?

thanks in advance
Primüs is offline   Reply With Quote

Join OCAU to remove this ad!
Old 14th June 2017, 11:07 AM   #2
Primüs Thread Starter
Member
 
Primüs's Avatar
 
Join Date: Oct 2005
Location: Coffs Harbour, NSW
Posts: 3,260
Default

bah.

Literally 2 minutes after I post, i find my answer.

Setting KillMode=process under [Service] allows all spawned processes to keep running after the parent ends.

It's not a perfect solution but it works I'll adapt it over time.
Primüs is offline   Reply With Quote
Reply

Bookmarks

Sign up for a free OCAU account and this ad will go away!

Thread Tools

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 On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 10:09 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Micron21!