
DaeMon
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
DaeMon is a monitor/start/stop-applet for system-daemons (mysql,bluetooth,cups, etc.) created for ArchLinux-systems
To use it, just set the "polling directory" in the configuration-dialog to a
place where a file for each running daemon is created. In Arch-Linux this is
usually /var/run/daemons. Set the damon-start-scripts-directory to the place
where for each daemon a script exists that excepts the parameters "start" and
"stop" to execute the corresponding actions. In Arch-Linux this is /etc/rc.d.
For other distributions you might have to set a suffix for the files to poll.
Assume that your daemon is "called" cups i.e. and does create a file named
"cups.pid" in the polling directory the you have to enter ".pid" here.
Finally set the polling-interval to a value suitable for you and select the
daemons you would like to monitor/handle using DaeMon.
Since this is my very first plasma-applet and my first python-work for quite
some time I have to apologize for all the errors and imperfections of it. Right
now it is just slightly more than a finger exercise.
Please keep in mind, that I wrote it with an Arch-Linux system in mind, though
it should work for othe distributions as well.
Quite a lot of things can undoubtly be improved and if there is any interest in
the following ideas or if you have something else in mind that could be done,
please let me know.
- give more detailed feedback about the result of a start/stop
- create translations
- create and use a DBUS-service to handle starts und stops of daemons instead
of kdesu
I am always happy about any feedback if somebody really should decide to use
this. ;-)
Have fun!
11 years ago
0.1 - first try
0.2 - some minor fixes (allow to startup when default polling-directory does not exist, typing-errors)
replaced method of formatting strings to allow running on python < 2.6
added suffix of polling files to configuration dialog
11 years ago
0.1 - first try
0.2 - some minor fixes (allow to startup when default polling-directory does not exist, typing-errors)
replaced method of formatting strings to allow running on python < 2.6
added suffix of polling files to configuration dialog
scheffe
11 years ago
this applet does not run under kde 4.3.
The traceback from .xsession-errors says following:
Traceback (most recent call last):
File "/usr/share/apps/plasma_scriptengine_python/pyappletscript.py", line 55, in init
self.pyapplet.init()
File "/home/frank/.kde4/share/apps/plasma/plasmoids/DaeMon/contents/code/main.py", line 49, in init
self.initSettings()
File "/home/frank/.kde4/share/apps/plasma/plasmoids/DaeMon/contents/code/main.py", line 166, in initSettings
self.settings["polling_interval"] = int(self.cg.readEntry("polling_interval", "2000").toInt())
TypeError: int() argument must be a string or a number, not 'tuple'
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
Report
gkrnours
11 years ago
DaeMon display an error icon, and "right click" -> "DaeMon settings" does nothing.
I haven't hacked a lot the source, but gooler trick doesn't do the job. Line around 69 and 80 doesn't seems to be the problem...
Report
MalteDik
11 years ago
if you just check out /var/run, you might miss some services, see (the most important services have their own subdirs):
$ find /var/run -type f -name "*.pid"
/var/run/console-kit-daemon.pid
/var/run/mysqld/mysqld.pid
/var/run/crond.pid
/var/run/atd.pid
/var/run/cups/cupsd.pid
find: `/var/run/cups/certs': Permission denied
find: `/var/run/hald': Permission denied
/var/run/inetd.pid
/var/run/dirmngr.pid
/var/run/acpid.pid
/var/run/rsyslogd.pid
find: `/var/run/PolicyKit': Permission denied
/var/run/portmap.pid
/var/run/dhclient.wlan0.pid
Report
paulocr
11 years ago
I tried with standard instructions from http://www.kde-look.org/help/index.php?type=70&PHPSESSID=c7d3091939a0e62a75d52e53875fc161
but the I get an error from the CMake.
Report
tiberiusGER
11 years ago
this is a plasmoid written in python. You do not have to compile it. Just open you "Add Widgets..."-Dialog from your panel (i.e.) and choose "Install New Widgets" .> "Install Widgets From Local File". Select the plasmoid-file you downloaded and it should work.
Make sure you have python, python-kde-bindings and python-plasma-bindings installed.
Also please keep in mind that it (right now) works only on ArchLinux smoothly.
Report
paulocr
11 years ago
I read some forums and other people were getting also errors with other plasmoids so they installed manually. This is the reason why I was asking
Report
gooler
11 years ago
It partially works now, although plasmoids installer warns about installation errors.
To use it, I've entered:
Polling directory:
/var/run
suffix
*.pid
Daemon startup scripts:
/etc/init.d
Selected a few daemons as they are correctly listed, clicked Ok. The selected daemons shows in the plasmoid, all with a + symbol before, but clicking on any of them does nothing.
So a great improvement here :D
Report
tiberiusGER
11 years ago
When I click on a listed daemon it opens up kdesu. You do have kdesu available on kubuntu, haven't you?
Maybe it is better to continue working on the via email and ot fill up this page too much (I had nearly overlooked your post). Would you mind contacting me that way? My address in in the readme.txt within the plasmoid-file.
Report
gooler
11 years ago
Now with DaeMon, I've tried to install it in Kubuntu 8.10 amd64 and I get the following error:
"Installing the package DaeMon... failed"
Then it shows in the add component dialog but when you add it to the desktop it shows the following error:
"Could not create a python scriptEngine for the DaeMon widget"
so I went and installed 'python-plasma' package. Then added the widget again and now another error shows:
"Initialization script failed"
Hope this can be of any help.
Report
tiberiusGER
11 years ago
/var/run/daemons
exists, when you add the applet. I will upload a corrected version later today.
I am not at all sure that it works with Kubuntu out of the box though. As I said I will have a look at it.
Since the file is just a zip-file you can open it with Ark (for example) and have a look at the source inside.
Report
billux13
11 years ago
I have these following errors in my .xsession-errors :
Traceback (most recent call last):
File "/usr/share/kde4/apps/plasma_scriptengine_python/pyappletscript.py", line 55, in init
self.pyapplet.init()
File "/home/billux/.kde/share/apps/plasma/plasmoids/DaeMon/contents/code/main.py", line 69, in init
header.setText("<font color=\"{color}\">Available Services:</font>".format(color=labelColor))
AttributeError: 'str' object has no attribute 'format'
TypeError: invalid result type from PythonAppletScript.shape()
TypeError: invalid result type from PythonAppletScript.shape()
...
And the directory /var/run/daemons doesn't exist on debian based distro :/
If you want others precisions about kubuntu, don't hesitate to ask me.
Report
tiberiusGER
11 years ago
I will also add a source package the next few days.
Report
gooler
11 years ago
Report
gooler
11 years ago
After removing that calls from the lines 69 and 80 and changing the default daemon polling path to 'var/run' for example in 165 in main.py the plasmoid interface shows in desktop. It doesn't show any daemon, but at least the interface shows.
Now, if you try to configure it, xsessions-errors shows another "object has no attribute 'format'" error that corresponds to #74 in configdaemons.py, removing the format call again makes the configuration dialog work too.
Now, the only thing left is substitute the current format() calls for another that can be applied and know where the daemons can be polled in Debian based distributions.
Hope this helps.
Report
gooler
11 years ago
After removing that calls from the lines 69 and 80 and changing the default daemon polling path to 'var/run' for example in 165 in main.py the plasmoid interface shows in desktop. It doesn't show any daemon, but at least the interface shows.
Now, if you try to configure it, xsessions-errors shows another "object has no attribute 'format'" error that corresponds to #74 in configdaemons.py, removing the format call again makes the configuration dialog work too.
Now, the only thing left is substitute the current format() calls for another that can be applied and know where the daemons can be polled in Debian based distributions.
Hope this helps.
Report
gooler
11 years ago
After removing that calls from the lines 69 and 80 and changing the default daemon polling path to 'var/run' for example in 165 in main.py the plasmoid interface shows in desktop. It doesn't show any daemon, but at least the interface shows.
Now, if you try to configure it, xsessions-errors shows another "object has no attribute 'format'" error that corresponds to #74 in configdaemons.py, removing the format call again makes the configuration dialog work too.
Now, the only thing left is substitute the current format() calls for another that can be applied and know where the daemons can be polled in Debian based distributions.
Hope this helps.
Report
gooler
11 years ago
Report
tiberiusGER
11 years ago
Report
tiberiusGER
11 years ago
Report
tiberiusGER
11 years ago
Report
gooler
11 years ago
Also there is a tool called chkconfig that allows to control the services from the command-line, if you want to check its code.
Report
billux13
11 years ago
"Failure of initialisation script".
Could you make a version for this distro ?
And so could you add a link to the plasmoid's sources ? There is only the binary version...
Report
tiberiusGER
11 years ago
Report