KDE4 systemd service start-limit error

I’m a KDE user (ver 4.14) running on CentOS 7.6.
I’m trying to install an old Logitech G15 keyboard on Linux. I managed to get everything installed and I’m trying to set up a systemd service so that the daemon will start up upon reboot.

The service file which i named it G15daemon_Logitech.service has been placed here:
/usr/lib/systemd/system

The file content is as below:

[Unit]
Description=Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD

[Service]
ExecStart=/usr/sbin/g15daemon
Restart=always

[Install]
WantedBy=multi-user.target

Enabling the service is fine, however the service does not autostart upon reboot. Checking its status using systemctl status G15daemon_Logitech.service
gave out the following

G15daemon_Logitech.service - Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD
Loaded: loaded (/usr/lib/systemd/system/G15daemon_Logitech.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Tue 2019-10-08 08:59:27 +08; 5h 6min ago
Process: 9509 ExecStart=/usr/sbin/g15daemon (code=exited, status=0/SUCCESS)
Main PID: 9509 (code=exited, status=0/SUCCESS)

I’m not that expert in Linux OS. Only use it at the office. Any ideas on how to resolve this?

Hi nabilishes,
if it starts manually, but not on boot it might be another service is started AFTER this service, but G15daemon_Logitech cannot start if this other service is not started first.
When u started manually it is not a problem as this other service was already started.

Can u run

journalctl -u G15daemon_Logitech

and display the output?

To see what the logs say?

Thanks.

Hi fabek,
I’ve asked my IT admin to run the command as i don’t have root access, and below is the output

root@lnx1762-064> journalctl -u G15daemon_Logitech
– Logs begin at Wed 2019-10-09 08:36:26 +08, end at Wed 2019-10-09 08:40:01 +08. –
Oct 09 08:36:42 lnx1762-064 systemd[1]: Started Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 09 08:36:43 lnx1762-064 systemd[1]: G15daemon_Logitech.service holdoff time over, scheduling restart.
Oct 09 08:36:43 lnx1762-064 systemd[1]: Stopped Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 09 08:36:43 lnx1762-064 systemd[1]: Started Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 09 08:36:44 lnx1762-064 systemd[1]: G15daemon_Logitech.service holdoff time over, scheduling restart.
Oct 09 08:36:44 lnx1762-064 systemd[1]: Stopped Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 09 08:36:44 lnx1762-064 systemd[1]: Started Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 09 08:36:46 lnx1762-064 systemd[1]: G15daemon_Logitech.service holdoff time over, scheduling restart.
Oct 09 08:36:46 lnx1762-064 systemd[1]: Stopped Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 09 08:36:46 lnx1762-064 systemd[1]: Started Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 09 08:36:48 lnx1762-064 systemd[1]: G15daemon_Logitech.service holdoff time over, scheduling restart.
Oct 09 08:36:48 lnx1762-064 systemd[1]: Stopped Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 09 08:36:48 lnx1762-064 systemd[1]: Started Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 09 08:36:49 lnx1762-064 systemd[1]: G15daemon_Logitech.service holdoff time over, scheduling restart.
Oct 09 08:36:49 lnx1762-064 systemd[1]: Stopped Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 09 08:36:49 lnx1762-064 systemd[1]: start request repeated too quickly for G15daemon_Logitech.service
Oct 09 08:36:49 lnx1762-064 systemd[1]: Failed to start Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 09 08:36:49 lnx1762-064 systemd[1]: Unit G15daemon_Logitech.service entered failed state.
Oct 09 08:36:49 lnx1762-064 systemd[1]: G15daemon_Logitech.service failed.

the g15daemon can start manually but it requires root access to run the command.

Hi nabilishes,
was the package installed through the distribution official repositories?
Assuming the service file you showed came with the instsallation and u didn’t change it, it is strange is not using a script like /etc/init.d/g15daemon, but directly the binary.

Please add the line inside the [Service] section

Environment=SYSTEMD_LOG_LEVEL=debug

save the service file

Then

sudo systemctl daemon-reload
sudo systemctl restart G15daemon_Logitech

and re-check the output of
sudo journalctl -u G15daemon_Logitech

Hi fabek,
The drivers were downloaded from Github, since logitech does not provide linux drivers for its keyboard with the additional buttons. The keyboard itself works fine except for the additional programmable buttons and LCD which need the G15daemon to function.

The service file was created manually. The drivers installation does not include the service on start-up.
Previously I had a 3D mouse installed and added the service file based on instruction from a forum which had other users installing the mouse. The content of the service file is similar to the one i pasted above. It works fine for the mouse. So i use the same method to create the service file for the g15daemon and enable the service after creating the service file.

The reason why i did not create a script in init.d because in my system (KDE) the init scripts have been replaced with systemd service files. There is a README file in the /etc/init.d folder:

You are looking for the traditional init scripts in /etc/rc.d/init.d,
and they are gone?

Here’s an explanation on what’s going on:

You are running a systemd-based OS where traditional init scripts have
been replaced by native systemd services files. Service files provide
very similar functionality to init scripts. To make use of service
files simply invoke “systemctl”, which will output a list of all
currently running services (and other units). Use “systemctl
list-unit-files” to get a listing of all known unit files, including
stopped, disabled and masked ones. Use “systemctl start
foobar.service” and “systemctl stop foobar.service” to start or stop a
service, respectively. For further details, please refer to
systemctl(1).

Note that traditional init scripts continue to function on a systemd
system. An init script / etc/rc.d/init.d/foobar is implicitly mapped
into a service unit foobar.service during system initialization.

Thank you!

Further reading:
man:systemctl(1)
man:systemd(1)
** SOME LINKS WHICH I HAVE REMOVED DUE TO NEW USERS NOT ALLOWED TO POST LINKS**

I added the line in the [Service] section. And here are the journal debug logs:

Oct 14 10:32:14 lnx1762-064 systemd[1]: Started Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 14 10:32:15 lnx1762-064 systemd[1]: G15daemon_Logitech.service holdoff time over, scheduling restart.
Oct 14 10:32:15 lnx1762-064 systemd[1]: Stopped Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 14 10:32:15 lnx1762-064 systemd[1]: Started Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 14 10:32:17 lnx1762-064 systemd[1]: G15daemon_Logitech.service holdoff time over, scheduling restart.
Oct 14 10:32:17 lnx1762-064 systemd[1]: Stopped Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 14 10:32:17 lnx1762-064 systemd[1]: Started Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 14 10:32:18 lnx1762-064 systemd[1]: G15daemon_Logitech.service holdoff time over, scheduling restart.
Oct 14 10:32:18 lnx1762-064 systemd[1]: Stopped Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 14 10:32:18 lnx1762-064 systemd[1]: Started Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 14 10:32:19 lnx1762-064 systemd[1]: G15daemon_Logitech.service holdoff time over, scheduling restart.
Oct 14 10:32:19 lnx1762-064 systemd[1]: Stopped Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 14 10:32:19 lnx1762-064 systemd[1]: Started Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 14 10:32:20 lnx1762-064 systemd[1]: G15daemon_Logitech.service holdoff time over, scheduling restart.
Oct 14 10:32:20 lnx1762-064 systemd[1]: Stopped Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 14 10:32:20 lnx1762-064 systemd[1]: start request repeated too quickly for G15daemon_Logitech.service
Oct 14 10:32:20 lnx1762-064 systemd[1]: Failed to start Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 14 10:32:20 lnx1762-064 systemd[1]: Unit G15daemon_Logitech.service entered failed state.
Oct 14 10:32:20 lnx1762-064 systemd[1]: G15daemon_Logitech.service failed

Hi Nabilishes,
I know that now systemd service files should be used; but that message just says old Sys V scripts style are like deprecated, it doesn’t prevent to use them, especially in case of old software.

Anyway, as my intention was to help on getting the systemd service file working, I would suggest u to add the below option

Type=forking

Below the

[Service ]

section; always referring to the file content u posted.

As before reload the systemd daemon and restart the service.

And let me know: thanks.

Hi fabek,

I also found a similar suggestion on other linux forums regarding the keyboard that also mentioned what you have just suggested. I added the options below under service in my systemd service file.

[Service]
Type=forking
PIDFile=/run/g15daemon.pid

Finally it started! Below are the log files.
I did a normal restart too and confirm that the service is loaded. The status is showing that the service is active and running.
If you don’t mind me asking, may I know what does these options do?

Oct 14 10:42:06 lnx1762-064 systemd[1]: Starting Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD…
Oct 14 10:42:07 lnx1762-064 systemd[1]: PID file /run/g15daemon.pid not readable (yet?) after start.
Oct 14 10:42:07 lnx1762-064 systemd[1]: Started Start Logitech G15 g15daemon that makes it possible to use the G-buttons and draw on the G15 LCD.
Oct 14 10:42:07 lnx1762-064 g15daemon[12907]: Booting plugin “Linux UINPUT Keyboard Output”
Oct 14 10:42:07 lnx1762-064 g15daemon[12907]: Plugin “Linux UINPUT Keyboard Output” boot successful.
Oct 14 10:42:07 lnx1762-064 g15daemon[12907]: Booting plugin “LCDServer”
Oct 14 10:42:07 lnx1762-064 g15daemon[12907]: Plugin “LCDServer” boot successful.
Oct 14 10:42:07 lnx1762-064 g15daemon[12907]: Booting plugin “Clock”
Oct 14 10:42:07 lnx1762-064 g15daemon[12907]: Plugin “Clock” boot successful.

Hello,
Glad it works now, the PID option is to keep track of the process, for example, to avoid starting it twice.
And the type fork should work with any classic (legacy) daemon; in this case, without these options, it could not start and kept trying (hence the message "repeated too quickly).

Hi fabek,

Thanks for the explanation and also for your help and guidance!