Free Software UK

Discussion about Free Software here in the UK

You are not logged in.

 
Login with widget uLogin

#1 2018-01-21 12:56:29

Xylon
Administrator
From: Worthing, South East
Registered: 2016-10-16
Posts: 61
Website

Systemd kills interactive service

I just solved an annoying problem with systemd and I thought it would be helpful to post the solution.

I wanted to make an interactive service that runs at boot. It uses the TTY to take some user input to tell it how to set up certain mounts.

It worked except it always got killed after 3 seconds. Took me ages to work out why, as logs simply showed "Killed".

Turns out that when the boot completed and getty@tty1.service activated, it killed my interactive script. Presumably because it was using sdtin & stdout.

Solution was to add the following to the .service file:

Before=getty@tty1.service

More helpful info available here: https://bbs.archlinux.org/viewtopic.php?id=194792


Forum Founder and Boss. View my blog and submit to my FS success stories platform.

Fellow of the FSFE (#3509)

Offline

Board footer

Free Software UK forum - founded by Joseph Graham, hosted by Mythic Beasts, Powered by FluxBB