Il 14/12/2013 12:55, Dridi Boukelmoune
ha scritto:
Hi, On Sat, Dec 14, 2013 at 12:44 PM, Mattia Verga <mattia.verga@xxxxxxxxxx> 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. Ok, I tried to edit the boincxhost script in this way: #!/bin/sh xhost +SI:localuser:boinc sleep 1 Now if I run the script from console I get: $ /usr/bin/boincxhost localuser:boinc being added to access control list $ xhost access control enabled, only authorized clients can connect SI:localuser:boinc SI:localuser:marvin But if I run it within systemd unit the service is started, but xhost command "silently" fails: # systemctl start boinc-client.service # systemctl status boinc-client.service boinc-client.service - Berkeley Open Infrastructure Network Computing Client Loaded: loaded (/usr/lib/systemd/system/boinc-client.service; disabled) Active: active (running) since sab 2013-12-14 14:52:25 CET; 4s ago Process: 2843 ExecStopPost=/bin/rm -f /var/lib/boinc/lockfile (code=exited, status=0/SUCCESS) Process: 2947 ExecStartPre=/usr/bin/boincxhost (code=exited, status=0/SUCCESS) Process: 2944 ExecStartPre=/usr/bin/chown boinc:boinc /var/log/boinc.log /var/log/boincerr.log (code=exited, status=0/SUCCESS) Process: 2941 ExecStartPre=/usr/bin/touch /var/log/boinc.log /var/log/boincerr.log (code=exited, status=0/SUCCESS) Process: 2938 ExecStartPre=/bin/sleep 1 (code=exited, status=0/SUCCESS) Main PID: 2952 (boinc) CGroup: name=systemd:/system/boinc-client.service ├─2952 /bin/bash /usr/bin/boinc --dir /var/lib/boinc └─2953 /usr/bin/boinc_client --allow_multiple_clients --dir /var/l... dic 14 14:52:23 deneb systemd[1]: Starting Berkeley Open Infrastructure Net..... dic 14 14:52:24 deneb boincxhost[2947]: xhost: unable to open display "" dic 14 14:52:25 deneb systemd[1]: Started Berkeley Open Infrastructure Netw...t. # xhost access control enabled, only authorized clients can connect SI:localuser:marvin |
-- devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/devel Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct