13

I could not able to find any GUI tool that manage services in Ubuntu. I run Ubuntu as Virtual Box machine on Windows. I have tried to use System Jobs but it does not work.

I have LAMP server and I want to make some control on starting it as a service or not. I know that there are terminal commands performs the job. However, I need a GUI like those on the Windows to make things easier for the LAMP or any other service.

3

4 Answers 4

9

What I was looking for is:

sudo apt install kde-cli-tools kde-config-systemd

Running it with:

$ kcmshell5 kcm_systemd

Seeing as that this is the first hit on Google when searching for "ubuntu services manager gui", and it didn't contain the right answer, I will teach you how to find this - and any tool, if you have something to go on. Let's check our Linux/Distribution version:

$ cat /etc/issue
Ubuntu 16.04.3 LTS \n \l

This tells us our OS. Mine is Ubuntu 16.04. Like most Linuxes, Ubuntu has switched to systemd for managing its services. You would find this out by doing a web search for "ubuntu service". Let's see if there is a systemd package that alludes to being an interface, manager or GUI. (Graphical User Interface).

apt search systemd

We can now scroll up (Shift+PgUP - or on a laptop, Shift+Fn+Up). You can of course also look for "service" or "services". Hey, look, there is a systemd-ui. Let's install it!

sudo apt install systemd-ui

Great! Now what? How do I find out what the command is, or what it installed? Luckily there is a command that shows us what files are installed by a package:

dpkg-query -L systemd-ui

(Or)

dpkg -S systemd-ui

This shows us:

/usr/share/applications/systemadm.desktop

You would have to know that .desktop files are shortcuts in the Gnome desktop environment. You can look inside the .desktop file:

$ cat /usr/share/applications/systemadm.desktop
[Desktop Entry]
Name=systemadm
Comment=Manage Systemd Units
Exec=systemadm
Icon=applications-system
Terminal=false
Type=Application
Categories=System;Settings;

You can search for the specification of Gnome shortcuts. It is rather self-explanatory, though: Exec=systemadm. Categories=System;Settings. So look under your "System" or "Settings" menus under your applications, or simply run it:

$ systemadm

Voila! Oh, wait... this is a rather useless utility. It says "Manager" but it only allows you to view, no disabling, stopping, starting anything. How annoying! You can see the exact same by typing:

$ systemctl

It just shows it in a neater way... But with systemctl you can actually manage it too. So let's continue the search... this time, suppose we don't have a terminal with search or scroll functionality, let's use "less". To search in less, type "/" and to quit "q":

$ apt search systemd|less -S

After a wild goose chase with old gnome utilities such "gnome-system-tools" (which is equally useless as systemadm) - hey, nothing is preventing you from learning programming and improving systemadm, that's what linux is all about - but why reinvent the wheel if it already exists... to let's continue the search...

 kde-config-systemd - KDE control center module for Systemd

Now that looks promising. The KDE guys are usually ahead of the curve with their utilities... let's check it out:

sudo apt install kde-config-systemd

Great... now how do we run it?...

dpkg-query -L kde-config-systemd

Whoa! That is just too much to search through... let's see if there is a ".desktop" file in there...

$ dpkg-query -L kde-config-systemd|grep \\.desktop$

You can just grep for "desktop" too, then it will show you all the lines that contain "desktop", and not just the ones that end in ".desktop". Without the \., the . is meaningless, it just means "any character" to grep. With just a \., the shell will eat up the \ and send the next literal character to grep, so still just a \. We want to tell grep that the . is a literal . and grep also uses a \ to say that the next character is literal. So \\ sends a \ to grep, and then the $ means "end of line" so it means we're looking for a line that ends in ".desktop". And look! There are 2:

 /usr/share/kservices5/kcm_systemd.desktop
 /usr/share/kservices5/settings-system-administration.desktop

Now, you can just "cat" or edit them individually to see what's in them, but you can also do search both quite easily. We will feed the output of the above to a command that will feed each line individually to another command. The command that does that is called "xargs". The command we'll feed it to, is grep. If you give grep just one parameter, it searches the standard input. If you give it two+ parameters, it will treat the first as the search string, and the rest as files in which it will search.

 $ dpkg-query -L kde-config-systemd|grep \\.desktop$|xargs grep -i exec
 /usr/share/kservices5/kcm_systemd.desktop:Exec=kcmshell5 kcm_systemd

Okay, so now we have a command, let's try it:

$ kcmshell5 kcm_systemd
The program 'kcmshell5' is currently not installed. You can install it by typing:
sudo apt install kde-cli-tools

Thanks, Ubuntu. So we have discovered a missing dependency in the Ubuntu packages. When we install kde-config-systemd, it should automatically install kde-cli-tools! So I can fix this! I will now go and update the package file and create a pull request (or if you don't know how, just log a bug at the "ubuntu bug tracker" and someone else will do it, and fix it for everybody.)

So, for now:

$ sudo apt install kde-cli-tools 

And now that it's done:

$ kcmshell5 kcm_systemd

Voila! Congratulations, now you have a GUI... where you can break your system by disabling things... or speed it up by disabling unncessary things. But how do you know which is which? Perhaps to get rid of cupsd (because you never print stuff), or avahi-daemon (because you never use file sharing or chat or other gimmicky network stuff)... it would've been easier and safer to just uninstall them? ...

Anyways, I hope you're now at least a few steps closer to making Linux better for everyone.

6

You can do almost the same thing with webmin. From Webmin's homepage:

What is Webmin?

Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely. See the standard modules page for a list of all the functions built into Webmin.

To install it, run the following command from a terminal window:

First, add the repository:

sudo bash -c 'echo "deb http://download.webmin.com/download/repository sarge contrib" >> /etc/apt/sources.list'

Then install the key:

wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc

Then update and install webmin:

sudo apt update
sudo apt install webmin

Installation instructions came from: http://www.webmin.com/deb.html

After it is installed, then you can access it by opening a browser to https://localhost:10000/

Login as a registered user on the host that has sudo access.

enter image description here

Hope this helps!

2
  • Not sure I'd the OP likes it but I do. Seems like a great tool. Sep 1, 2016 at 17:13
  • Sounds like a great tool. Definitely will try
    – Anwar
    Sep 1, 2016 at 19:30
3

I would recommmend systemd-manager . Especially for 16.04. I believe it's going to be a great tool to manage services.

I have given installation and usage procedure on another related answer, that's why not repeating same content twice. Check this answer for the question How do I improve boot speed

6
  • Very good but how could I find the Apache server which is a part of LAMP?Or generally what about services that is not displayed on it?
    – SaidbakR
    Sep 1, 2016 at 19:46
  • 1
    @S Was apache not there? I need to check . I can do it tomorrow (night here). Will update / delete the answer accordingly
    – Anwar
    Sep 1, 2016 at 19:56
  • What ever, you find Apache or not, do not delete the answer. It is useful.
    – SaidbakR
    Sep 1, 2016 at 22:37
  • 1
    @sємsєм I've found the cause of it. apache still didn't fully converted their service script to systemd format. That's why it's not appearing in systemd-manager. Though it can be managed by systemctl via another helper program systed-sysv-install. I think apache will soon provide full support for systemd
    – Anwar
    Sep 2, 2016 at 9:44
  • dose not seem to be working with 17.10,yet :(
    – Neel
    Oct 26, 2017 at 8:34
-1

Now I'm using Kubuntu 18.04 and I found a nifty built-in tool for this purpose it is ksysguard print it in the terminal to open it like the following screen shot:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .