You are not logged in.

#1 2016-06-18 12:51:38

sarneet
Member
Registered: 2016-06-18
Posts: 3

Error Code 203 systemd

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

#2 2016-06-18 13:03:24

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: Error Code 203 systemd

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

#3 2016-06-18 15:18:30

sarneet
Member
Registered: 2016-06-18
Posts: 3

Re: Error Code 203 systemd

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

#4 2016-06-18 15:21:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: Error Code 203 systemd

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

#5 2016-06-18 18:57:22

sarneet
Member
Registered: 2016-06-18
Posts: 3

Re: Error Code 203 systemd

OK. I must have misunderstood it. Still familiarizing with the terminology. Thanks. I'll try this way

Offline

Board footer

Powered by FluxBB