Restart services via terminal plus cron job?

Moderator: Lillian.W@AST

Post Reply
cjens19
Posts: 3
youtube meble na wymiar Warszawa
Joined: Wed Apr 10, 2019 10:08 pm

Restart services via terminal plus cron job?

Post 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!
User avatar
orion
Posts: 3485
Joined: Wed May 29, 2013 11:09 am

Re: Restart services via terminal plus cron job?

Post 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.
cjens19
Posts: 3
Joined: Wed Apr 10, 2019 10:08 pm

Re: Restart services via terminal plus cron job?

Post by cjens19 »

Thank you for the crontab command. What is the command for restarting apps?
User avatar
orion
Posts: 3485
Joined: Wed May 29, 2013 11:09 am

Re: Restart services via terminal plus cron job?

Post by orion »

cjens19 wrote:Thank you for the crontab command. What is the command for restarting apps?
Every app acts in different ways.
cjens19
Posts: 3
Joined: Wed Apr 10, 2019 10:08 pm

Re: Restart services via terminal plus cron job?

Post 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.
User avatar
orion
Posts: 3485
Joined: Wed May 29, 2013 11:09 am

Re: Restart services via terminal plus cron job?

Post 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.
User avatar
Nazar78
Posts: 2055
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: Restart services via terminal plus cron job?

Post 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.
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
Post Reply

Return to “ADM general”