How to restart process running on Ubuntu 14.x version

Awais Khan

I am new with Ubuntu. Please help me for this mentioned issue. This shaded area in attached image is my process that is running on Ubuntu 14.x version. It is python program which is reading a configuration file. When I am changing some configuration I always shut down "kill [process ID]" this process and start it. On new startup it takes new process ID.

Process Image

My client is non-technical guy he/she can not kill the process with changed ID and start it. I want such utility (command) that he/she can restart the process programmatically. what ever the process ID will be.

I have tried below thing:

sudo restart scheduler.py
sudo restart python3 scheduler.py
sudo scheduler.py restart
sudo python3 scheduler.py restart

All above tries are useless. Please help me

Raphael

One way to achieve what you desire is as follows:

pkill scheduler.py
python3 /path/to/scheduler.py

You can also put it in a shell script.

To stop the process:

#!/bin/bash

pkill scheduler.py

exit 0

And save it as anyname1.sh

To start the process:

#!/bin/bash

python3 /path/to/scheduler.py

exit 0

Now, save it as anyname2.sh

Then, run this command to make them executable:

chmod +x /path/to/anyname1.sh
chmod +x /path/to/anyname2.sh

So, now, all your friend needs to do is double-click on those files and then click on Run.

EDIT: If the first script doesn't work as expected you may try this:

#!/bin/bash

kill -9 $(ps axf | grep scheduler.py | grep -v grep | awk '{print $1}')

exit 0

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Update the python version running spark Ubuntu 14

From Dev

How to restart (or reset) a running process in linux

From Dev

How to restart (or reset) a running process in linux

From Dev

How to restart remote MySQL server running on Ubuntu linux?

From Dev

how to kill process in Mac OS X and not have it restart on its own

From Dev

How to restart KDE window decorations without loosing the running X session

From Dev

How to test if the Couchbase process is running in Ubuntu?

From Dev

How to keep a process running indefinitely on ubuntu server

From Dev

How to restart the taskgated process?

From Dev

How to install Windows 7 in a PC running Ubuntu 14?

From Dev

Monitor process and restart when not running using crontab

From Dev

How to check java version of a running java process used

From Dev

How to supervise and automatically restart a process?

From Dev

How to install x-debug and verify in ubuntu 14

From Dev

How to install Netbeans 8.0.2 on ubuntu 14.x

From Dev

how to install mariasql with nodejs 4.x on ubuntu 14?

From Dev

How to automatically restart crond if it is not running?

From Dev

Running commands on shutdown/restart Ubuntu 18.04

From Dev

How to restart failed process with parent process in python

From Dev

Create Ubuntu version that refreshes after each restart

From Dev

Create Ubuntu version that refreshes after each restart

From Dev

How to identify which process is running which window in Mac OS X?

From Dev

Running a long process on Ubuntu server

From Java

How to restart PostgreSQL in Ubuntu 18.04

From Dev

How to wipe Ubuntu upon restart

From Dev

How to hide a running process ?

From Dev

How to get the process that is running

From Dev

How to bind the docker container and the cuba process through localhost:9292 in Ubuntu 14

From Dev

How to install Ubuntu on a Mac running OS X Lion?

Related Related

  1. 1

    Update the python version running spark Ubuntu 14

  2. 2

    How to restart (or reset) a running process in linux

  3. 3

    How to restart (or reset) a running process in linux

  4. 4

    How to restart remote MySQL server running on Ubuntu linux?

  5. 5

    how to kill process in Mac OS X and not have it restart on its own

  6. 6

    How to restart KDE window decorations without loosing the running X session

  7. 7

    How to test if the Couchbase process is running in Ubuntu?

  8. 8

    How to keep a process running indefinitely on ubuntu server

  9. 9

    How to restart the taskgated process?

  10. 10

    How to install Windows 7 in a PC running Ubuntu 14?

  11. 11

    Monitor process and restart when not running using crontab

  12. 12

    How to check java version of a running java process used

  13. 13

    How to supervise and automatically restart a process?

  14. 14

    How to install x-debug and verify in ubuntu 14

  15. 15

    How to install Netbeans 8.0.2 on ubuntu 14.x

  16. 16

    how to install mariasql with nodejs 4.x on ubuntu 14?

  17. 17

    How to automatically restart crond if it is not running?

  18. 18

    Running commands on shutdown/restart Ubuntu 18.04

  19. 19

    How to restart failed process with parent process in python

  20. 20

    Create Ubuntu version that refreshes after each restart

  21. 21

    Create Ubuntu version that refreshes after each restart

  22. 22

    How to identify which process is running which window in Mac OS X?

  23. 23

    Running a long process on Ubuntu server

  24. 24

    How to restart PostgreSQL in Ubuntu 18.04

  25. 25

    How to wipe Ubuntu upon restart

  26. 26

    How to hide a running process ?

  27. 27

    How to get the process that is running

  28. 28

    How to bind the docker container and the cuba process through localhost:9292 in Ubuntu 14

  29. 29

    How to install Ubuntu on a Mac running OS X Lion?

HotTag

Archive