LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Bash script to start/stop LAMP on GECKO static Plasma. (https://www.linuxquestions.org/questions/linux-server-73/bash-script-to-start-stop-lamp-on-gecko-static-plasma-4175695869/)

pavllvap 06-01-2021 11:54 AM

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.

michaelk 06-01-2021 02:53 PM

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

pavllvap 06-01-2021 03:47 PM

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.

michaelk 06-01-2021 07:00 PM

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.

ondoho 06-02-2021 12:31 AM

Quote:

Originally Posted by pavllvap (Post 6255731)
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 (Post 6255731)
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.

pavllvap 06-02-2021 11:45 AM

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

MadeInGermany 06-08-2021 01:58 PM

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

pavllvap 06-08-2021 02:08 PM

Thank you - MadeInGermany

Help appreciated. Paul


All times are GMT -5. The time now is 07:43 PM.