You are not logged in.
Pages: 1
Hello guys
I'm trying to run this scipt
res.sh
at startup using systemd. It changes my resolution to 1920x1080. The contents of the script are:-
xrandr --newmode "1920x1080" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 1920x1080
xrandr --output Virtual1 --mode 1920x1080
The corresponding service is
#!/bin/sh -
[Unit]
Description=My script
[Service]
Type=oneshot
ExecStart=/home/sarneet/Desktop/res.sh
[Install]
WantedBy=multi-user.target
This service is not running. The status is
res.service - My script
Loaded: loaded (/usr/lib/systemd/system/res.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2016-06-18 18:26:33 BDT; 20min ago
Process: 363 ExecStart=/home/sarneet/Desktop/res.sh (code=exited, status=203/EXEC)
Main PID: 363 (code=exited, status=203/EXEC)
Jun 18 18:26:33 sarneet-pc systemd[1]: Starting My script...
Jun 18 18:26:33 sarneet-pc systemd[1]: res.service: Main process exited, code=exited, status=203/EXEC
Jun 18 18:26:33 sarneet-pc systemd[1]: Failed to start My script.
Jun 18 18:26:33 sarneet-pc systemd[1]: res.service: Unit entered failed state.
Jun 18 18:26:33 sarneet-pc systemd[1]: res.service: Failed with result 'exit-code'.
I even added the
#/bin/sh -
as suggested in other threads.
The error code is 203.
Please guide me as to what i'm doing wrong. Any help will be apppreciated.
Thank-you
Offline
Run the script as your normal user after xorg server has started.
Use .xinitrc instead of systemd.
EDIT: Welcome!
Also, run the script from commandline before starting xorg to see why it doesn't work.
Last edited by teateawhy (2016-06-18 13:04:26)
Offline
The script is working, but i have to run it manually, I'm trying to automate it so that i don't have to do this at startup each time.
Offline
sarneet, please actually read teateawhy's post. The script works when you run it manually from within X. That script most definitely will not work when X is not running (e.g., when the system is still booting up).
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
OK. I must have misunderstood it. Still familiarizing with the terminology. Thanks. I'll try this way
Offline
Pages: 1