You are not logged in.

#1 2016-08-27 22:22:46

GENXLR
Member
From: Las Vegas
Registered: 2016-08-25
Posts: 8

Autostart daemon at xinit with root access

So my thinkpad has a small app i use named tpb that allows me to see the OSD for my thinkpads functions, the really helpful one is volume. My biggest issue is I hate every time i enter my x session having to open a terminal and type

sudo tpb -d

enter a password

and then be done, I'd like to automate it, but there's restrictions

It cannot be run at boot, it must be ran after the x server is fully started, starting it at boot fails to hook the xosd and causes the process to terminate.
It must be ran as root because it requires access to /dev/nvram
I'd like it to run with no user input


If anyone can help that'd be AWESOME!

Last edited by GENXLR (2016-08-27 22:29:17)


Hardware: IBM T42, CPU Intel Pentium M 755, GPU Radeon Mobility 9600, RAM 2GB, HDD 40GB
OS: Archlinux 4.7.1-1, xfce 4.12

Offline

#2 2016-08-27 22:36:38

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Autostart daemon at xinit with root access

Run it as a --user service.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2016-08-27 23:24:51

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

Re: Autostart daemon at xinit with root access

I second the user service recommendation.  But if you need another alternative, just make a NOPASSWD entry for that specific command in your sudoers file, then in your xinitrc you can just put "sudo tpb -d" and it will work fine.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#4 2016-08-28 02:02:11

GENXLR
Member
From: Las Vegas
Registered: 2016-08-25
Posts: 8

Re: Autostart daemon at xinit with root access

I would use a user service but I forgot to mention that I do not use a Display Manager so currently I login with a terminal and if i need X for my session, I startxfce4

my apologies, but with that said, @Trilby suggestion of making it a no password command means it would work in an xinit.rc config, which may be exactly what I'm looking for.


Hardware: IBM T42, CPU Intel Pentium M 755, GPU Radeon Mobility 9600, RAM 2GB, HDD 40GB
OS: Archlinux 4.7.1-1, xfce 4.12

Offline

#5 2016-08-28 02:05:58

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Autostart daemon at xinit with root access

You don't need a display manager for user services...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2016-08-28 02:57:02

GENXLR
Member
From: Las Vegas
Registered: 2016-08-25
Posts: 8

Re: Autostart daemon at xinit with root access

jasonwryan wrote:

You don't need a display manager for user services...

Yes but when I login, won't it run the service while the x server is not started?


Hardware: IBM T42, CPU Intel Pentium M 755, GPU Radeon Mobility 9600, RAM 2GB, HDD 40GB
OS: Archlinux 4.7.1-1, xfce 4.12

Offline

#7 2016-08-28 03:15:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Autostart daemon at xinit with root access

You can make it wait on X.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2016-08-28 03:21:43

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: Autostart daemon at xinit with root access

Or, you can run it as a system service and allow a user with an active local to activate it using policy kit: https://wiki.archlinux.org/index.php/Po … ular_users


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#9 2016-08-28 03:22:15

GENXLR
Member
From: Las Vegas
Registered: 2016-08-25
Posts: 8

Re: Autostart daemon at xinit with root access

jasonwryan wrote:

You can make it wait on X.

Really!? I couldn't figure it out earlier, Can I get some wiki links or similar help? I got lost trying to do it earlier, thats PERFECT!


Hardware: IBM T42, CPU Intel Pentium M 755, GPU Radeon Mobility 9600, RAM 2GB, HDD 40GB
OS: Archlinux 4.7.1-1, xfce 4.12

Offline

#10 2016-08-28 03:28:44

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Autostart daemon at xinit with root access


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2016-08-28 05:53:11

GENXLR
Member
From: Las Vegas
Registered: 2016-08-25
Posts: 8

Re: Autostart daemon at xinit with root access

Wow that's alot to take in. I'm struggling with that at the moment. I might need help figuring it out.


Hardware: IBM T42, CPU Intel Pentium M 755, GPU Radeon Mobility 9600, RAM 2GB, HDD 40GB
OS: Archlinux 4.7.1-1, xfce 4.12

Offline

Board footer

Powered by FluxBB