Desktop file for a service

Adithyansm

Active Member
Joined
Nov 11, 2021
Messages
226
Reaction score
99
Credits
1,625
Hello everyone :D
How can I create a .desktop file for a service to start?
the service is
Code:
sudo systemctl start emby-server.service
I want it to execute with sudo permission when clicked
you can provide me with the steps is to achieve this or you can give me the format for the desktop file
Help would be appreciated
 


Potentially unsafe, and/or may not work. Untested.

1. Create [script] on your desktop, with your command (minus "sudo").
2. chmod +swrx [script] - allows the normal user to edit and execute file after ownership changes. also sets the setuid flag.
3. chown root:root [script] - change ownership to root.

What you should end up with is a script that belongs to, and is run as root, and is maintainable by normal user. Shouldn't require sudo.

Anyone else who'd like to check my work ... please do.
 

Members online


Top