FedoraThis forum is for the discussion of the Fedora Project.
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.
I'm a linux desktop newbie (have some experience with linux via ssh). I've set up a desktop machine with Fedora 26 to run backuppc. Why Fedora 26? Because no extras are needed in order to install backuppc, it can be installed via dnf.
Anyway, I'm trying to get a script to run at startup. It does run if manually started. Its got 751 permissions. I know that's excessive, but I'm trying to fix the problem it doesn't run automatically at startup.
The script starts up backuppc and starts up apache:
Right now my system is littered with attempts to make this script start. I've got copies of it all over the place :-(. I've tried ~/.config/autostart methods, I've tried making /etc/rc.local but apparently systemd based linux doesn't like that method. I've tried making a service that calls the script and that hasn't helped. I've tried using a .desktop file and that hasn't helped.
However I haven't tried making a service with the commmand lines in it directly and I think it's time to ask the experts or stump the chumps! I wonder if the problem has to do with automatically running a service that runs a script with systemctl commands?
Maybe there's another way to do this? Thanks for being there!
Yes, I've been googling extensively on this topic and have spent many fruitless hours trying different scenarios for startup scripts as I mentioned.
Yes, I'm using Grub, though I don't understand the relevance of that. I understand that grub 2 is in the boot sector and refers to a config file on the main sector. But that's for the early part of the boot, the kernel. I'd like my script to run after login.
once you enable a systemd service, it starts automatically at boot.
so there's no need for the script!
i would replace the last line with 'systemctl enable apache2' - but again, not scripted! only once!
once you enable a systemd service, it starts automatically at boot.
so there's no need for the script!
i would replace the last line with 'systemctl enable apache2' - but again, not scripted! only once!
reboot => instant joy!
Thanks ondoho. VERY HELPFUL! That did it. On Fedora 26 I had to do
systemctl enable http
And that was the key. Now I have to search through and delete all my useless startup scripts! This thread can be closed. Again, thanks, everyone.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.