You are not logged in.

#1 2016-06-26 09:14:17

Sviests
Member
From: Riga, Latvia
Registered: 2016-03-24
Posts: 42

[Solved] Writing a systemd service

Hi!

I am trying to write a systemd service for the Tilda terminal to start automatically but something seems to be going wrong.
This is the example I`m using: www.freedesktop.org/software/systemd/ma … l#Examples
This is the service I`ve written and saved as tilda.service:

# Auto-startup service for the Tilda terminal

[Unit]
Description=Tilda

[Service]
ExecStart=/usr/bin/tilda

[Install]
WantedBy=multi-user.target

I`ve enabled the service using:

systemctl enable tilda.service 
Created symlink /etc/systemd/system/multi-user.target.wants/tilda.service → /etc/systemd/system/tilda.service.

But once I start it, I get this error:

systemctl start tilda.service 
Failed to add /run/systemd/ask-password to directory watch: No space left on device

After I`ve tried starting the tilda.service, I get this error when running any systemctl command (e.g. status), for any service. Once I`ve disabled the tilda.service and rebooted, the message does not appear anymore.

My /run directory is not full as it can be seen by running

df -h                                      
Filesystem      Size  Used Avail Use% Mounted on
dev             3,9G     0  3,9G   0% /dev
run             3,9G  1,0M  3,9G   1% /run
/dev/sda5        20G   13G  5,7G  69% /
tmpfs           3,9G  496K  3,9G   1% /dev/shm
tmpfs           3,9G     0  3,9G   0% /sys/fs/cgroup
tmpfs           3,9G   76K  3,9G   1% /tmp
/dev/sda6        52G   16G   34G  32% /home
/dev/sda2       495M  308M  188M  63% /boot
tmpfs           787M   16K  787M   1% /run/user/120
tmpfs           787M   24K  787M   1% /run/user/1000
s

This is the the output of systemctl status:

systemctl status tilda.service 
● tilda.service - Tilda
   Loaded: loaded (/etc/systemd/system/tilda.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sv 2016-06-26 11:04:00 CEST; 7min ago
  Process: 3940 ExecStart=/usr/bin/tilda (code=exited, status=1/FAILURE)
 Main PID: 3940 (code=exited, status=1/FAILURE)

jūn 26 11:04:00 Eriks-ThinkPad systemd[1]: Started Tilda.
jūn 26 11:04:00 Eriks-ThinkPad tilda[3940]: Unable to init server: Could not connect: Connection refused
jūn 26 11:04:00 Eriks-ThinkPad tilda[3940]: Error parsing Glib and GTK specific command-line options. Try "tilda --help-all"
jūn 26 11:04:00 Eriks-ThinkPad tilda[3940]: to see all possible options.
jūn 26 11:04:00 Eriks-ThinkPad tilda[3940]: Error message: Cannot open display:
jūn 26 11:04:00 Eriks-ThinkPad systemd[1]: tilda.service: Main process exited, code=exited, status=1/FAILURE
jūn 26 11:04:00 Eriks-ThinkPad systemd[1]: tilda.service: Unit entered failed state.
jūn 26 11:04:00 Eriks-ThinkPad systemd[1]: tilda.service: Failed with result 'exit-code'.

Thanks in advance!

Last edited by Sviests (2016-06-26 09:52:37)

Offline

#2 2016-06-26 09:46:48

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [Solved] Writing a systemd service

Tilda is a terminal emulator for X. You shouldn't run that as root and you can't just run it without an X server (hence "cannot open display").

The normal way to do this kind of thing is using ~/.xinitrc or a similar startup script (or your DE's GUI for autostarting applications).

You could also try it as a service in your systemd user instance, but you'd have to make sure it starts after X (also probably easiest to do with one of these startup scripts, but you'd start tilda, or a custom "X" target that contains tilda, through systemctl).

Offline

#3 2016-06-26 09:52:19

Sviests
Member
From: Riga, Latvia
Registered: 2016-03-24
Posts: 42

Re: [Solved] Writing a systemd service

Right, I`ve added Tilda to the startup applications for Gnome which should do the trick. I don`t know how I forgout about doing that big_smile.

Thank you for your help!

Offline

Board footer

Powered by FluxBB