LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 10-06-2018, 12:57 PM   #1
BrandNewToUbuntu
LQ Newbie
 
Registered: Oct 2018
Posts: 10

Rep: Reputation: Disabled
Execute script on System bootup ( OpenVPN )


Hi,

I've successfully setup a OpenVPN and wrote a script to start the VPN etc and am running on Ubuntu 18.04.1 LTS.

Now, no matter what I try, it doesn't seem to be possible to run that script when the system boots up.

I've tried to place the script in etc/init & init.d with 777 as attribute and root as owner.

I've also tried to use the "Startprogramme" App in Ubuntu and some kind of terminal registration script for registering scripts for startup ( after network starts ).

How can I get my script to be run on boot so that I don't have to start it manually each time?
 
Old 10-06-2018, 06:27 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
Run the script from a systemd service. Just open any service file on the system that runs at boot, and change it to what you need. Then save it under a different name.
 
1 members found this post helpful.
Old 10-07-2018, 11:40 AM   #3
BrandNewToUbuntu
LQ Newbie
 
Registered: Oct 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AwesomeMachine View Post
Run the script from a systemd service. Just open any service file on the system that runs at boot, and change it to what you need. Then save it under a different name.
Worked out perfectly...sometimes, after having tried tons of possible ways, you don't even see the easiest solution

Thx, AwesomeMachine !!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
execute my script before tomcat at bootup fachhoch@gmail.com Linux - Newbie 1 05-18-2012 02:14 PM
[SOLVED] Shutdown :The system goes down before my rc script execute ! alcazar64 Red Hat 8 04-02-2010 10:31 AM
perl script system() only execute one command knockout_artist Programming 4 11-11-2008 10:57 AM
Cannot execute rc.4d, Slackware 12, bootup annihilan Slackware 5 07-29-2008 10:02 PM
Add/remove programs that execute on bootup c_olin3404 Debian 1 09-07-2005 02:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration