2
Introduction
I've recently upgraded to Fedora 17 and I'm getting used to the newer systemctl
daemon manager versus shell init scripts.
A feature I need on some of my daemons is the ability to interact with their consoles because unclean shutdowns not initiated by the process itself can cause database corruption. So, performing a systemctl stop service-name.service
for example might cause irreversible data loss.
These consoles read user input through stdin or similar methods, so what I've been doing on my old OS is to place those daemons foregrounded in a screen
session, and I suspended that screen session with ^A ^z
. It's also worth noting that I've now made systemctl
do this automatically if the computer reboots, but it still doesn't solve my potential data corruption problem I'm trying to avoid.
My Question
Is there a way to use systemctl
in order to directly interact with the console of processes it spawns? Can I hook a process through systemctl
to get access to its console?
Thanks
You guys always give great answers, so I'm turning to you!
In general, init scripts are not meant to be interactive. A better approach would be to make
systemctl stop
send a signal to the daemon telling it to shut itself down cleanly. – mattdm – 2012-09-23T00:15:21.717