Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The problem I'm facing is when I run the script in terminal, it works right.
Code:
$ sudo systemctl is-active jackett.service
unknown
$ qbit.sh &
[1] 25326
$ sudo systemctl is-active jackett.service
active
And finally when qBittorrent app is closed by mouse.
$ sudo systemctl is-active jackett.service
unknown
But when I execute qBit.desktop, jackett.service is not started.
Code:
$ sudo systemctl is-active jackett.service
unknown
Now qBit app is opened by clicking its icon in menu. Still jackett.service is not started.
$ sudo systemctl is-active jackett.service
unknown
When you run it from the terminal you are authenticating to sudo before calling the script in the line
Code:
sudo systemctl is-active jackett.service
I am not sure how this behaves in the execution environment of the .desktop file.
You may have to enable password-less execution for the script and call it with sudo.
EDIT: If you do play with password-less execution make sure that you are not running the graphical application as root unintentionally.
I also just had one other thought: I have no idea what jackett is, but you might be able to run it as a regular user if you install the service file in your home directory and start the service with the --user option.
See e.g. here for more info: https://wiki.archlinux.org/index.php/Systemd/User
Last edited by joe_2000; 04-26-2019 at 04:32 PM.
Reason: added info on system user service
Another observation: running from the terminal, you are running your script in background. Not the case when run from the .desktop I’m not sure what thar means, but it is a difference.
It depends on the service. As stated above I do not know what jackett does. If the process can run with normal user privileges it might not be necessary, but you then have to setup the service as a user service as described in the arch wiki article I linked to in a previous post.
Quote:
Originally Posted by lordmax10
Yes I know, and normallly it's sufficient
The /etc/init.d calls should be considered as deprecated under systemd systems. There is a compatibility layer in Debian (and presumbly its *buntu derivatives), but I wouldn't recommend to use it unless you have good reasons.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.