Coder Social home page Coder Social logo

Comments (3)

NovaRemitly avatar NovaRemitly commented on May 13, 2024 1

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.

nbari avatar nbari commented on May 13, 2024

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.

nbari avatar nbari commented on May 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.