Help needed with systemd script

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Sat Dec 14 11:55:10 UTC 2013


Hi,

On Sat, Dec 14, 2013 at 12:44 PM, Mattia Verga <mattia.verga at tiscali.it> wrote:
> Hello,
> I'm trying to give a user access rights to X with xhost command.
> I've created a script named '/usr/bin/boincxhost' (chmod 555) like this:
>
> #!/bin/sh
> xhost +SI:localuser:boinc &> /dev/null
> exit 0

"exit 0" will hide a non-zero exit status of the previous command.

In this case I'm not sure what's happening, but if you're running the
command in background, and don't wait for it to complete, you may be
facing a race condition.

> If I run it from command line it works fine.
> But I want to run from a systemd unit at startup. So I added this line to
> the unit file:
>
> ExecStartPre=/usr/bin/boincxhost
>
> The service starts without errors, but I cannot find the user to have rights
> for accessing X. Maybe someone can tell me where I'm wrong in the procedure?
> Or is there any other way to give that user access to X? I already tried to
> add the user to the 'video' group, but Boinc refuse to see the GPU
> available.
> Thanks for any hint.
>
> Mattia
>
> --
> devel mailing list
> devel at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/devel
> Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct


More information about the devel mailing list