You are not logged in.

#1 2013-11-13 10:57:46

Gulver
Member
Registered: 2013-05-24
Posts: 208

`rc-local` counterparty in Systemd [SOLVER]

Hi there,

Is there any way that I can add a couple of bash commands as root in Systemd files?

Even thought I still haven't figured a way to write a working service files; It is really meaningless to create something else that have no contemporary mean.

I'm trying to turn off extra-GPU with switcheroo.

This is rc-local I created:

#!/bin/sh
# Run command at boot-up

sudo chmod -R 705 /sys/kernel/debug
sudo chown -R gulver:users /sys/kernel/debug/vgaswitcheroo/switch
sudo echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

Service gave 203 error while running exec. Halp an idiot out hmm

Last edited by Gulver (2013-11-13 12:42:57)

Offline

#2 2013-11-13 11:06:46

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 10,893
Website

Re: `rc-local` counterparty in Systemd [SOLVER]

See if tmpfiles.d can fulfil your needs.

man tmpfiles.d

This seems like an overly complex way of disabling a GPU, but I'm not familiar with swicheroo. There is systemd-vgaswitcheroo-units in the AUR though, is that any use to you?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2013-11-13 11:15:04

Gulver
Member
Registered: 2013-05-24
Posts: 208

Re: `rc-local` counterparty in Systemd [SOLVER]

Thank you! Both works out, how did I forgot about AUR...

Offline

#4 2013-11-13 11:59:45

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 10,893
Website

Re: `rc-local` counterparty in Systemd [SOLVER]

Great stuff. Remember to mark your thread as [SOLVED] by editing your first post and changing the subject, thanks.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB