Giter Site home page Giter Site logo

Help with ponzu as daemon about ponzu HOT 12 CLOSED

ponzu-cms avatar ponzu-cms commented on May 1, 2024
Help with ponzu as daemon

from ponzu.

Comments (12)

nilslice avatar nilslice commented on May 1, 2024

Hi - what OS are you using? Could you share your init script? Admittedly, this is not an area in which I have much expertise but will try to see if I can help.

from ponzu.

axenovV avatar axenovV commented on May 1, 2024

@nilslice Ubuntu 16.04, this is my init script: https://github.com/ponzu-cms/ponzu/blob/master/deployment/sysv/ponzu-server

As I understand it to use it as a daemon, the same script is in my project directory, which has been generated with ponzu gen

from ponzu.

nilslice avatar nilslice commented on May 1, 2024

I'm on mobile at the moment, and would otherwise try to find a resource to share with you.. I've only used this with init.d (sysv), but I believe it is compatible with Upstart. Maybe google something like "init.d script usage with upstart"?

from ponzu.

nilslice avatar nilslice commented on May 1, 2024

In the script I have provided, did you assign the $VARIABLES in the script to use your project info?

from ponzu.

axenovV avatar axenovV commented on May 1, 2024

@nilslice I've solved the problem, I do not have the variables in the script. Thanks

from ponzu.

nilslice avatar nilslice commented on May 1, 2024

Ok, great. If you are able to share, I'd love to see what to made!

from ponzu.

axenovV avatar axenovV commented on May 1, 2024
PROJECT_DIR=/home/ponzu/work/src/remoteConfig
SCRIPT="cd $PROJECT_DIR && /home/ponzu/work/bin/ponzu --port=8080 run"
RUNAS=ponzu

PIDFILE=/home/ponzu/run/ponzu-server.pid
LOGFILE=/home/ponzu/log/ponzu-server.log

start() {
  if [ -f /var/run/$PIDNAME ] && kill -0 $(cat /var/run/$PIDNAME); then
    echo 'Service already running' >&2
    return 1
  fi
  echo 'Starting service…' >&2
  local CMD="$SCRIPT &> \"$LOGFILE\" & echo \$!"
  su -c "$CMD" $RUNAS > "$PIDFILE"
  echo 'Service started' >&2
}

stop() {
  if [ ! -f "$PIDFILE" ] || ! kill -0 $(cat "$PIDFILE"); then
    echo 'Service not running' >&2
    return 1
  fi
  echo 'Stopping service…' >&2
  kill -15 $(cat "$PIDFILE") && rm -f "$PIDFILE"
  echo 'Service stopped' >&2
}

uninstall() {
  echo -n "Are you really sure you want to uninstall this service? That cannot be undone. [yes|No] "
  local SURE
  read SURE
  if [ "$SURE" = "yes" ]; then
    stop
    rm -f "$PIDFILE"
    echo "Notice: log file is not be removed: '$LOGFILE'" >&2
    update-rc.d -f ponzu-server remove
    rm -fv "$0"
  fi
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  uninstall)
    uninstall
    ;;
  restart)
    stop
    start
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|uninstall}"
esac

from ponzu.

nilslice avatar nilslice commented on May 1, 2024

Hah sorry, I meant the project you made with Ponzu. But the script looks right!

from ponzu.

axenovV avatar axenovV commented on May 1, 2024

@nilslice Yes, I use ponzu as simple api for mobile app

from ponzu.

nilslice avatar nilslice commented on May 1, 2024

Hm. There should be a new Etag generated when you update content in the CMS which invalidates cache automatically.

The check mark never stays checked, as it is just a indicator that you want to manually invalidate the cache when you click the Save button on that page.

Have you tried doing a hard refresh in the browser? It should have updated when you changed the content, but it will help to know if you've hard refreshed the browser yet.

from ponzu.

axenovV avatar axenovV commented on May 1, 2024

@nilslice I've solved problem with cache :) thanks)

from ponzu.

nilslice avatar nilslice commented on May 1, 2024

You bet. Glad you fixed it

from ponzu.

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.