GithubHelp home page GithubHelp logo

hartl3y94 / templateedgeagentar4k Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rossonet/templateconsoleapplication

0.0 0.0 0.0 359 KB

Template project EdgeAgentAr4k lib

License: GNU Affero General Public License v3.0

Dockerfile 1.44% Java 89.71% Shell 8.85%

templateedgeagentar4k's Introduction

Gitpod ready-to-code Test on master branch

Template Edge app Rossonet

Reference

Library Documentation

Tech blog

Run as a service

Install as local init.d service

The script supports the following features:

  • Starts the services as the user that owns the jar file

  • Tracks the application’s PID by using /var/run/ar4kAgent/ar4kAgent.pid

  • Writes console logs to /var/log/ar4kAgent.log

Assuming that you have a Ar4k Agent application installed in /var/ar4kAgent, to install it as an init.d service, create a symlink, as follows:

$ sudo ln -s /var/ar4kAgent/ar4kAgent.jar /etc/init.d/ar4kAgent

Once installed, you can start and stop the service in the usual way. For example, on a Debian-based system, you could start it with the following command:

$ service ar4kAgent start

Install as Systemd service

Systemd is the successor of the System V init system and is now being used by many modern Linux distributions. Although you can continue to use init.d scripts with systemd, it is also possible to launch Ar4kAgent by using systemd ‘service’ scripts.

Assuming that you have a Ar4kAgent installed in /var/ar4kAgent, to install a Spring Boot application as a systemd service, create a script named ar4kAgent.service and place it in /etc/systemd/system directory. The following script offers an example:

[Unit]
Description=Ar4k Agent 
After=syslog.target

[Service]
Type=simple
User=root
#ExecStartPre=/opt/pre-start.sh
#ExecStopPost=/opt/post-stop.sh
ExecStart=/var/ar4kAgent/ar4kAgent.jar --spring.shell.interactive.enabled=false
PIDFile=/tmp/ar4k-agent.pid
RemainAfterExit=no
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target

Note that, unlike when running as an init.d service, the user that runs the application, the PID file, and the console log file are managed by systemd itself and therefore must be configured by using appropriate fields in the ‘service’ script. Consult the service unit configuration man page for more details.

To flag the application to start automatically on system boot, use the following command:

$ systemctl enable ar4kAgent.service

Refer to man systemctl for more details.

Install as Windows service

The windows distribution uses winsw.

Warning

You need to install the .NET framework on the target machine first.

To install the sample application as a service, extract the distribution somewhere and open a shell with administrative rights in that directory. Then invoke the following command

$ ar4kAgent install

Once the service has been installed, you can start it the usual way, that is:

$ net start ar4kAgent

The logs are available in the logs directory of the distribution.

Docker build

git clone https://github.com/rossonet/TemplateEdgeAgentAr4k.git
cd TemplateEdgeAgentAr4k
docker build --rm -t ar4k-agent:latest .

[...]

docker run -ti --rm ar4k-agent:latest

alt text

https://www.rossonet.net

templateedgeagentar4k's People

Contributors

rossonet avatar

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.