You are not logged in.

#1 2018-03-06 21:09:59

ItalianoVero
Member
Registered: 2018-03-03
Posts: 6

[SOLVED] Creating *.service file

Hello,

I have problem with creating .service file to enable it to systemctl

I have script

#!/bin/sh
xrandr --newmode "1440x900_60.00" 106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync
xrandr --addmode DVI-I-2 1440x900_60.00
xrandr --output DVI-I-2 --mode 1440x900_60.00

Resolution change if i do

sudo ./script.sh

I also make setRes.service file

[Unit]
Description=setRessss

[Service]
ExecStart=/home/xyz/script.sh

[Install]
WantedBy=multi-user.target

What i expect ?
-> exec that script automaticly after start OS

Last edited by ItalianoVero (2018-03-07 21:26:24)

Offline

#2 2018-03-06 21:25:47

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: [SOLVED] Creating *.service file

What is starting the X server before multi-user.target so it is available for your service to use?
Edit:
Although you are not using a user service what is setting the DISPLAY and XAUTHORITY variables? User#DISPLAY_and_XAUTHORITY

Last edited by loqs (2018-03-06 21:28:06)

Offline

#3 2018-03-06 21:39:06

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,738

Re: [SOLVED] Creating *.service file

ItalianoVero you accidentally hit report

ItalianoVero wrote:

    I do not understand what you are trying to say... smile sory im newbie

You either have to create an user service (read the entire page loqs linked to) or add those lines to whatever utility you use to start X it's initialization scripts instead of a systemd service. A system instance of systemd runs way before X has started so these lines will simply run into an error the way they are.

Offline

#4 2018-03-06 22:37:34

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] Creating *.service file

Is this not an XY problem?

The best way to set an unrecognised EDID is with an Xorg configuration file:

https://wiki.archlinux.org/index.php/Xr … esolutions

See also https://wiki.archlinux.org/index.php/ke … s_and_EDID

Offline

#5 2018-03-07 21:05:45

ItalianoVero
Member
Registered: 2018-03-03
Posts: 6

Re: [SOLVED] Creating *.service file

V1del wrote:

ItalianoVero you accidentally hit report

ItalianoVero wrote:

    I do not understand what you are trying to say... smile sory im newbie

You either have to create an user service (read the entire page loqs linked to) or add those lines to whatever utility you use to start X it's initialization scripts instead of a systemd service. A system instance of systemd runs way before X has started so these lines will simply run into an error the way they are.

You aright, sorry for "Report"....

Offline

#6 2018-03-07 21:25:44

ItalianoVero
Member
Registered: 2018-03-03
Posts: 6

Re: [SOLVED] Creating *.service file

It helps <3 Love you git a. Best forum ever!!!

Offline

Board footer

Powered by FluxBB