Coder Social home page Coder Social logo

Making daemon issue about snmpcollector HOT 4 CLOSED

toni-moreno avatar toni-moreno commented on May 27, 2024
Making daemon issue

from snmpcollector.

Comments (4)

toni-moreno avatar toni-moreno commented on May 27, 2024

Can you test again changing the base dir with "-d /opt/snmpcollector " option ?

  -d, --chdir path
              Chdir to path before starting the process. This is done after
              the chroot if the -r|--chroot option is set. When not
              specified, start-stop-daemon will chdir to the root directory
              before starting the process.

from snmpcollector.

vkosilko avatar vkosilko commented on May 27, 2024

I added full pathes to every option:
start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/snmpcollector.pid --background --exec /opt/snmpcollector/snmpcollector -- -config /opt/snmpcollector/conf/config.toml -logs /opt/snmpcollector/log/
Despite it, software use config file set in root folder: /conf
I found sql.log in root folder too: /log/sql.log
But device logs are saved to /opt/snmpcollector/log folder

from snmpcollector.

toni-moreno avatar toni-moreno commented on May 27, 2024

Would you like to add this init script at the github repo?
Can we close this issue now?

from snmpcollector.

vkosilko avatar vkosilko commented on May 27, 2024

@toni-moreno
I found that you use PWD variable as main appdir, so I updated my script.

#!/bin/sh
#/etc/init.d/snmpcollector

APPDIR=/opt/snmpcollector
PID=/var/run/snmpcollector.pid

case "$1" in
   start)
     echo "Starting snmpcollector"
     export PWD=$APPDIR
     start-stop-daemon --start --quiet --make-pidfile --pidfile $PID --chdir $APPDIR --background --exec ./snmpcollector -- -config $APPDIR/conf/config.toml -logs $APPDIR/log
     ;;
   stop)
     echo "Stopping snmpcollector"
     start-stop-daemon --stop --pidfile $PID
     rm -f $PID
     ;;
   *)
     echo "Usage: /etc/init.d/snmpcollector{start|stop}"
     exit 1
     ;;
esac

exit 0

from snmpcollector.

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.