+3
Answered

Custom Services in /etc/init.d/ do not show up in Ajenti Services Plugin

Ron DaDon 12 years ago updated by Eugene Pankov (Project coordinator) 12 years ago 3

Hello there!


I have installed ajenti and it is working. 


I am using sickbeard, couchpotato, pyLoad, headphones, sabnzbd.


I have put them all in the /var/www/ folder.

I am using init.d scripts to start/stop them manually and start them on boot.

It is all working but ajenti does not show them up in the "services" list.


If I run rcconf on debian it lists all these services but ajenti doesent show them up under the services tab.


I would really want to have the possibility to start and stop these custom services over the ajenti Web-UI.




If this is not possible with the services Plugin, Is there any way to bind custom shell commands to WebUI buttons, so I can start and stop those services with one click over the Ajenti WebUI.... This is something I am really missing.


THank you in advance!

Answer

PINNED

Hi Ron,


Ajenti uses "service --status-all" to get list of services. If your init.d script doesn't show up there, it's probably because it's missing metadata usually present in init.d scripts in the beginning of the file ("BEGIN INIT INFO" and stuff).

I've already written the click-to-run plugin but it will only arrive with the upcoming major update due to compatibility changes, but in the meantime, you can consider using Supervisord (http://supervisord.org/) which does exactly what you want, and as a bonus it will keep an eye on your services and restart them if they die. And it's fully supported by your Ajenti version, so you will also get a dashboard widget that shows process status and lets you [re]start/stop it.


Best regards!

PINNED

Hi Ron,


Ajenti uses "service --status-all" to get list of services. If your init.d script doesn't show up there, it's probably because it's missing metadata usually present in init.d scripts in the beginning of the file ("BEGIN INIT INFO" and stuff).

I've already written the click-to-run plugin but it will only arrive with the upcoming major update due to compatibility changes, but in the meantime, you can consider using Supervisord (http://supervisord.org/) which does exactly what you want, and as a bonus it will keep an eye on your services and restart them if they die. And it's fully supported by your Ajenti version, so you will also get a dashboard widget that shows process status and lets you [re]start/stop it.


Best regards!

thank you very much for your answer.


On all these scripts I have no "status" command in there so i think this could be the issue here.


Here is a script for example i postet on pastebin:


http://pastebin.com/QYBycbu4



This script does work but indeed has no "status" command in the script


When I run "service --status-all" i get this:


[ ? ]  bootmisc.sh

 [ ? ]  checkfs.sh

 [ ? ]  checkroot-bootclean.sh

 [ - ]  checkroot.sh

 [ ? ]  couchpotato

 [ + ]  cron

 [ - ]  hostname.sh

 [ ? ]  hwclock.sh

 [ ? ]  killprocs

 [ ? ]  kmod

 [ + ]  lighttpd

 [ - ]  motd

 [ ? ]  mountall-bootclean.sh

 [ ? ]  mountall.sh

 [ ? ]  mountdevsubfs.sh

 [ ? ]  mountkernfs.sh

 [ ? ]  mountnfs-bootclean.sh

 [ ? ]  mountnfs.sh

 [ ? ]  mtab.sh

 [ ? ]  networking

 [ - ]  procps

 [ ? ]  pyload

 [ ? ]  rc.local

 [ - ]  rmnologin

 [ + ]  samba

 [ ? ]  sendsigs

 [ ? ]  sickbeardtpb

 [ + ]  ssh

 [ - ]  stop-bootlogd

 [ - ]  stop-bootlogd-single

 [ + ]  supervisor

 [ + ]  transmission-daemon

 [ + ]  udev

 [ ? ]  udev-mtab

 [ ? ]  umountfs

 [ ? ]  umountnfs.sh

 [ ? ]  umountroot

 [ - ]  urandom


So where a "?" is in the brackets these services arent listed by ajenti service-plugin.



I am runngin ajenti on a really low profile ARM Board with 128MB Ram and I want to run as less services or programms needed. So I do not want to use an additional program like supervisor for it.

 

And a final question. When do you want to release the major update? Is there any date?


Thank you very much for your kind help! Greetings from Germany!! :)

Ron

Try adding a simple status) command to the scripts which just does "echo $0 is running; exit 0", that should make --status-all work. If it does, you can probably use "status) pgrep couchpotato; exit $?" or so to return a correct status exitcode.

I can't really give you an estimate on new release since there's so much to do and so little people around willing to help, but I hope I'll be giving out betas in a month or so.