You are not logged in.

#1 2018-09-22 17:46:06

super_trash
Banned
Registered: 2018-07-04
Posts: 50

[Solved] Can't start kbdrate.service

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.target

but 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

#2 2018-09-22 19:02:57

Piri
Member
Registered: 2018-06-02
Posts: 70

Re: [Solved] Can't start kbdrate.service

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=oneshot

is 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 wink

Offline

#3 2018-09-22 19:10:32

super_trash
Banned
Registered: 2018-07-04
Posts: 50

Re: [Solved] Can't start kbdrate.service

Piri wrote:

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=oneshot

is 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 wink

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

#4 2018-09-22 19:55:17

Piri
Member
Registered: 2018-06-02
Posts: 70

Re: [Solved] Can't start kbdrate.service

Yeah just enable the service and reboot then systemctl status should show that the service has been started.

Offline

Board footer

Powered by FluxBB