Autostart in systemd and ~/.xinitrc

Hello my new friends,
First of all, let me tell you, that this is an awesome distro.
Now to my problems.

1.) I added /usr/bin/xbindkeys to my ~/.xinitrc

looks like this now:

......
/usr/bin/xbindkeys
exec $(get_session)

Problem is, it doesnt start xbindkeys at logon, i always have to start it myself.

2.) I made an rclone-mount.service in /etc/systemd/system
Which looks like this:

[Install]
WantedBy=multi-user.target

[Unit]
Description=rclone-mount
Documentation=http://rclone.org/docs/
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=mastermind
Group=mastermind
ExecStart=/usr/bin/rclone --vfs-cache-mode writes mount -config=/home/mastermind/.config/rclone/rclone.conf onedrive: /home/mastermind/OneDrive/
ExecStop=/usr/bin/fusermount -uz /home/mastermind/OneDrive/
Restart=always

This works only one out of three starts.

Maybe someone could help me, what i do wrong here.

Thanks in advance.

The team's Mind Reader position is vacant and

Post system info
Read how-to and tutorials
Reporting bugs | Garuda Linux wiki

4 Likes

Maybe this would help?

https://wiki.archlinux.org/index.php/Autostarting

1 Like

I usually figure that when a service is failing intermittently that it is a timing issue and the service is attempting to run before the network connection is fully ready. Try adding ExecStartPre=/usr/bin/sleep 5 directly before your ExecStart= line. If that doesn't work you could try changing the target to something that loads later in the startup process such as your login.

3 Likes

Thanks for the assistance.
The ExecStartPre works quite well.
And now I know, I have to use xprofile and not xinitrc.