Skip to main content
Topic: [SOLVED] OpenRC user service does not work (Read 1390 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] OpenRC user service does not work

I have setup a user service using OpenRC. This user service is supposed to run when the user logs in. Either via GUI/DE/WM or via ssh or via tty login. The setup details of the service are given below. The tasks are that it creates a few directories and configuration.However when I log into the system, either using DE/WM or ssh or using tty the service is not executed. How can I fix this?

The Service file location
Code: [Select]
${XDG_CONFIG_HOME}/rc/init.d/tasknstep.service
${XDG_CONFIG_HOME} is defined in the environment parameters and it points to $HOME/.config

Service creation and confirmation
I have used the following commands to create the service and to validate that it is setup.
Code: [Select]
$ rc-update -U add tasknstep.service default
$ rc-update -U show
    tasknstep.service    |      default    
$ ls -alpF ${XDG_CONFIG_HOME}/rc/runlevels/default/tasknstep.service
lrwxrwxrwx 1 usera usera 52 Sep 13 11:20 /home/usera/.config/rc/runlevels/default/tasknstep.service -> /home/usera/.config/rc/init.d/tasknstep.service*

How to solve this issue? Can someone please give me some pointers and how to resolve this? All help would be appreciated.





Re: OpenRC user service does not work

Reply #2
Yep I have checked and all the actions have been done.
The /etc/init.d/user.<username> is linked to /etc/init.d/user.
The {XDG_CONFIG_HOME} variable is defined.
The service file and the shell script that is executes are all world executable, i.e. they have the permission 0755.
The service has been added using the following command
Code: [Select]
$ rc-update --user  add <service-name> default

Proposed Solution.
After checking with the fine folks at LibreChat, #openrc channel, I found that the /home partition was mounted with the option noexec. Once noexec was removed and the system restarted the service started to run. That was the solution.

This leads me to the follow up question. When Open-RC is not able to run a service, does it log it somewhere? How can I see in the logs what error or issue that OpenRC encountered while running the service?


Re: OpenRC user service does not work

Reply #3
not yet afaik, but you can check /run/user/<uid>/openrc/* for problems

artist

Re: OpenRC user service does not work

Reply #4
Is there some configuration that can be done so that OpenRC starts logging the failed services with the reason somewhere? 

Re: OpenRC user service does not work

Reply #5
Drop the *.service extension and it will work, this is not systemd. :p

 

Re: OpenRC user service does not work

Reply #6
Will do.