You are not logged in.
Pages: 1
wiki link: https://wiki.archlinux.org/index.php/Li … md_service
I have this kbdrate.service:
[Unit]
Description=Keyboard repeat rate in tty.
[Service]
Type=oneshot
RemainAfterExit=yes
StandardInput=tty
StandardOutput=tty
ExecStart=/usr/bin/kbdrate -s -d 450 -r 60
[Install]
WantedBy=multi-user.targetbut in console/tty I can't start this service. it keeps halting, and can't exit and put cursor back, I have to type ctrl-c to force exit.
Last edited by super_trash (2018-09-23 03:44:05)
Offline
The script is supposed to be just enabled so it can be run before logging into the terminal. If you read systemd.service(5) and systemd.exec(5) you will find that the combination of the lines
StandardInput=tty
Type=oneshotis at fault here. Since the tty is already in use by your user session the systemd service is waiting until your tty is free (which will never happen) before doing ExecStart. For a unit of type oneshot to be considered started whatever was started by ExecStart has to exit first.
This means: systemd can never acquire the tty -> ExecStart is never called -> the service is never considered started -> systemctl waits until the service is started -> systemctl never returns.
This is not a problem when booting/opening a new tty since the service will be started before your session runs on the tty, You should not really worry about that, just enable the service and go on with your life ![]()
Offline
The script is supposed to be just enabled so it can be run before logging into the terminal. If you read systemd.service(5) and systemd.exec(5) you will find that the combination of the lines
StandardInput=tty Type=oneshotis at fault here. Since the tty is already in use by your user session the systemd service is waiting until your tty is free (which will never happen) before doing ExecStart. For a unit of type oneshot to be considered started whatever was started by ExecStart has to exit first.
This means: systemd can never acquire the tty -> ExecStart is never called -> the service is never considered started -> systemctl waits until the service is started -> systemctl never returns.
This is not a problem when booting/opening a new tty since the service will be started before your session runs on the tty, You should not really worry about that, just enable the service and go on with your life
I've just made some test and can see the same problem as you mentioned. So a reboot with enabled service at boot and the service will be started probably?
Offline
Yeah just enable the service and reboot then systemctl status should show that the service has been started.
Offline
Pages: 1