You are not logged in.
Pages: 1
hi
i want to autostart prime with systemd/timer.and these are my files:
$ sudo nano /etc/systemd/system/prime.service
i wrote in it:
[Unit]
Description=Dual Graphic Technology
[Service]
Type=oneshot
ExecStart=xrandr --setprovideroffloadsink nouveau Intel
[Install]
RequiredBy=multi-user.targe
and define timer unit:
$ sudo nano /etc/systemd/system/prime.timer
and write:
[Unit]
Description=Run prime.service every boot system
[Timer]
OnBootSec=1min
Unit=prime.service
[Install]
WantedBy=multi-user.target
and enable timer:
sudo systemctl enable prime.timer
sudo systemctl start prime.timer
but when i reboot no action heppen!
and this is status of prime.service:
saeed@saeed ~]$ sudo systemctl status prime.service
● prime.service - Dual Graphic Technology
Loaded: loaded (/etc/systemd/system/prime.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2016-04-02 22:07:39 IRDT; 12s ago
Process: 10951 ExecStart=/home/saeed/Documents/Scripts/prime.sh (code=exited, status=203/EXEC)
Main PID: 10951 (code=exited, status=203/EXEC)
Apr 02 22:07:39 saeed systemd[1]: Started Dual Graphic Technology.
Apr 02 22:07:39 saeed systemd[1]: prime.service: Main process exited, code=exited, status=203/EXEC
Apr 02 22:07:39 saeed systemd[1]: prime.service: Unit entered failed state.
Apr 02 22:07:39 saeed systemd[1]: prime.service: Failed with result 'exit-code'.
any idea?
Offline
xrandr commands only work AFTER X has started .
There are logical places to put this command, like ~/.xinitrc for startx users, and autostart functionality for display managers.
IF you insist on using a systemd timer to run the xrandr command :
Have the timer fire after graphical.target has been reached but before your display manager starts.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
in addition to what has been said above, you will need to use absolute path with systemd, so simply "xrandr" will not work.
Arch is home!
https://github.com/Docbroke
Offline
Not a Sysadmin issue, moving to NC...
Offline
Pages: 1