Comments (3)
Yes, the -ctl
option is what I was looking for. Tested it out and it works perfectly. Thank you for the help, and for making such an awesome tool! 😃
from immortal.
Hi, the reason for not using names and using the PIDs is because sometimes the same process may be required to run multiple times within the same session and by having the same name they would collide.
For permanent process, persistent to reboots is better to create a small datelog.yml file, for example:
cmd: date
log:
file: /var/log/app-1.log
age: 86400 # seconds
num: 7 # int
size: 1 # MegaBytes
And put it within the immortaldir
/usr/local/etc/immortaldir/datelog.yml
By doing this, you could then identify the process by a given name:
$ immortalctl exit datelog
from immortal.
I forgot the IMMORTAL_SDIR
environment that can be used with the -ctl
option so to achive what you want just need to do something like:
export IMMORTAL_SDIR=/tmp/immortal
And then just run the command like this:
immortal -ctl datelog -l out.txt /bin/sh -c "date && sleep 5"
later by just typing immortalctl
you can see the name:
$ immortalctl
PID Up Down Name CMD
88716 3.0s datelog /bin/sh -c date && sleep 5
If the environment var IMMORTAL_SDIR
is not set, -ctl
defaults to /var/run/immortal/<name>
If you always want to use names instead of PIDs, just need to always set the IMMORTAL_SDIR
to the path where you would like to create the immortal.sock
Please give a try and let me know if working from your side.
from immortal.
Related Issues (20)
- How do you stop a process? HOT 3
- Have a lot of Defunct process when running immortal in a docker container HOT 1
- validate config file HOT 6
- Immortal on Raspberry HOT 13
- as Docker container process manager HOT 1
- Log files reopening HOT 3
- immortaldir should stop all services on exit HOT 1
- Improve web docs HOT 3
- Custom 'cleanup' action HOT 12
- immortaldir crashes with a high number of processes HOT 3
- immortal 0.24.0/0.24.1 upgrade issue HOT 5
- Are packagecloud immortal packages still maintained? HOT 2
- Lack of orthogonality: cmd vs require_cmd HOT 2
- Stopping a process HOT 2
- Custom immortaldir with wildcard? HOT 1
- Failing to install Immortal based on packagecloud.io HOT 2
- Require network
- jammy build HOT 2
- curl -s https://packagecloud.io/install/repositories/immortal/immortal/script.rpm.sh | sudo bash (Fails)
- option to keep trying and only stop when exit 0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from immortal.