LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-01-2021, 11:54 AM   #1
pavllvap
LQ Newbie
 
Registered: May 2021
Distribution: Gecko Static Plasma
Posts: 24

Rep: Reputation: Disabled
Bash script to start/stop LAMP on GECKO static Plasma.


Beginner with help from this forum now has a LAMP stack on Gecko Static Plasma (and a WAMP on Win10Pro using Uniserver Zero.)

Seeking a way to reliably start/stop the services ... but I do have them enabled so this might be a moot point ... asking anyway to get opinions/suggestions.

Have used the WAMP version with its integrated simple controller having form control buttons to start/stop Apache and MySQL etc.

Found this old post ... showing a bash script to do something similar but more basic.
https://www.linuxquestions.org/quest...-mysql-625028/

Wondering if this post is the way to go with my Leap 15.2 Gecko.
Not used bash scripts and so unsure how to proceed.

Am imagining that I will be making "unforced errors" and will likely need to stop and restart on a regular basis.
Would like to at least get that bit correct and reliable so that I can learn about actually getting my database started.

LAMP is default setup as per Leap Wiki.
 
Old 06-01-2021, 02:53 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,710

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
No, that thread from 2008 isn't applicable. Since the apache and mysql are enabled they will automatically start at boot so it really isn't necessarily to do anything else. Starting or stopping is as easy as

systemctl start service_name
or
systemctl stop service_name
or
systemctl restart service_name
 
Old 06-01-2021, 03:47 PM   #3
pavllvap
LQ Newbie
 
Registered: May 2021
Distribution: Gecko Static Plasma
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thank you - michaelk.
Have been using those commands but as I come from Windows and MS Access am used to being able to create my own forms and controls and click buttons !
And being new to Linux have been amazed how much typing happens for things done by gui buttons in Windows.
Thanks for advice on that old post.
 
Old 06-01-2021, 07:00 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,710

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
With linux the desktop runs on top of the operating system instead of integrated like Windows. There are few GUI tools but in most cases are just what we call wrappers that actually use the command line utilities. webmin is a GUI web based system administration tool. For MySQL there is MySQL workbench.
 
Old 06-02-2021, 12:31 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by pavllvap View Post
Have been using those commands but as I come from Windows and MS Access am used to being able to create my own forms and controls and click buttons !
You can do that with Linux, too.
Very simple to create your won GUI wrappers around commands.
Have a look at yad, for example.
Quote:
Originally Posted by pavllvap View Post
And being new to Linux have been amazed how much typing happens for things done by gui buttons in Windows.
And if you stick with it you'll be amazed how much more you can do with it, how much more control you have over things, and how much safer it is.
 
Old 06-02-2021, 11:45 AM   #6
pavllvap
LQ Newbie
 
Registered: May 2021
Distribution: Gecko Static Plasma
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thank you - michaelk & ondoho.
Good information, thanks.
Am now looking at "YAD".

Want to post a new question about best practice, setups, virtual etc so will end this conversation and start a new one with a better title.
Paul
 
Old 06-08-2021, 01:58 PM   #7
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,797

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
For service start and stop there is a portable "front end" command that translates to the actual implementation.
Code:
service service_name start
service service_name stop
service service_name restart
This translates to SysV, upstart, or systemctl
BTW some services take a "soft" restart
Code:
service service_name reload
To configure an automatic start at system boot, the old "chkconfig" front end might not translate to systemctl, so you have to use the "native" commands
Code:
systemctl enable service_name
systemctl disable service_name
And list all services with
Code:
systemctl list-unit-files
Last but not least, you can have a look at the service start/stop mechanism with
Code:
systemctl cat service_name
 
Old 06-08-2021, 02:08 PM   #8
pavllvap
LQ Newbie
 
Registered: May 2021
Distribution: Gecko Static Plasma
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thank you - MadeInGermany

Help appreciated. Paul
 
  


Reply



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
bash script that call another stop start script and use paarmeter stop,start ,status rcroyal88 Programming 5 07-21-2018 01:40 AM
Gecko plasma 5 rolling ... un1x SUSE / openSUSE 2 03-27-2017 09:53 AM
start script bash when system start,stop,reeboot, how ?? melmar Linux - General 4 12-10-2009 06:58 AM
kde4 on karmic: plasma-desktop doesn't start by itself after removing plasma-netbook eantoranz Linux - Software 8 10-10-2009 09:57 AM
AWK- processing data inside start/stop pairs but ignoring start/stop lines cliffoij Programming 2 10-15-2008 06:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:56 AM.

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
Open Source Consulting | Domain Registration