Page 1 of 2

Restart services via terminal plus cron job?

Posted: Tue Jan 12, 2021 7:07 am
by cjens19
Been scouring the web for a while now but haven't found anything that I need. I have an app on my Asustor that keeps dying (unsure why yet, don't have the bandwidth to troubleshoot), but it does come back up after I restart the app in the App Center. I'd like to automate this restart via a Cron job if possible, but I'm not sure if such a thing is possible with the ADM-nix OS.

Does anyone know how to restart apps/services via terminal? systemctl is not installed.

Does anyone know if it's possible to run cron jobs or some sort of scheduler? This is a moot point if it's not possible to restart services via terminal.

Thanks!

Re: Restart services via terminal plus cron job?

Posted: Tue Jan 12, 2021 1:14 pm
by orion
Both ways should work. You can post details if you got problems. And every app acts in different ways.
PS: "crontab -e" in command line to edit.

Re: Restart services via terminal plus cron job?

Posted: Tue Jan 12, 2021 9:33 pm
by cjens19
Thank you for the crontab command. What is the command for restarting apps?

Re: Restart services via terminal plus cron job?

Posted: Wed Jan 13, 2021 9:54 am
by orion
cjens19 wrote:Thank you for the crontab command. What is the command for restarting apps?
Every app acts in different ways.

Re: Restart services via terminal plus cron job?

Posted: Wed Jan 13, 2021 10:03 pm
by cjens19
Understand. Just wondering if there was a system command for restarting services. Like 'systemctl restart some.service' restarts stuff in ubuntu. I realize ADM is its own beast and has its own commands, just wondered if there was a similar command in ADM.

Also, is there a terminal command that shows all processes and names? Sort of like the GUI task manager but with real names of the executables?

Thank you for your responses, it's appreciated.

Re: Restart services via terminal plus cron job?

Posted: Thu Jan 14, 2021 9:45 am
by orion
Most of startup scripts of system services are located onto /usr/builtin/etc/init.d/
And all of apps are located onto /volume1/.@plugins/AppCentral/

I believe you can check them, then you should know what you need.

To show process: "ps" and "top" are useful commands.

Re: Restart services via terminal plus cron job?

Posted: Mon Jan 18, 2021 3:07 am
by Nazar78
You didn't mention which app, easier for us to help out. As orion stated most are in those location. Just run them with stop/restart/start switch. If it's a docker app then it's another way of restarting it, docker start/stop container-name. If you said that the restart doesn't work from the App Center, probably it's hanging, force kill it prior restarting i.e. kill -9 pid-of-app or ps -ef|grep app-name|awk '{print $1}'|xarg kill -9 or killall -9 app-name.

Re: Restart services via terminal plus cron job?

Posted: Mon Apr 22, 2024 3:21 am
by duckpinchris
hw can you restart the web center? As since the last update my web center is not working so anything stored in the Web folder is not working. I already tried reinstalling Apache App but that didnt help i also rebooted multiple times. So i wanted to try to restart the service manually

Re: Restart services via terminal plus cron job?

Posted: Mon Apr 22, 2024 10:02 am
by Nazar78
duckpinchris wrote: Mon Apr 22, 2024 3:21 am hw can you restart the web center? As since the last update my web center is not working so anything stored in the Web folder is not working. I already tried reinstalling Apache App but that didnt help i also rebooted multiple times. So i wanted to try to restart the service manually

Code: Select all

killall -9 apache2;/usr/local/AppCentral/httpd-2.4.43/CONTROL/start-stop.sh start
The above is for apache, kill nginx and change the folder above to nginx if you're using it instead.

I believe your issue could be you're trying to use ports that's already been used by other processes (check with `netstat -lntp|grep -E ':(80|443) '`) or certificate issues? These are the two usual issues why the daemon fail to start and ADM doesn't seems to handle these errors well.

Re: Restart services via terminal plus cron job?

Posted: Tue Apr 23, 2024 8:53 pm
by duckpinchris
i will give that a try as i use apache on here. Just i didnt have this issue in till the update came out on the 18th and i installed and rebooted and it hasent worked since and everytime i rebot things dont work anymore like my docker contianers which require manually re running them to start working. I was having issues with the m.2 cards but that that is a nother issue but these issues in question with dockert and web center just started since the update.