Skip to content

Instantly share code, notes, and snippets.

View scp93ch's full-sized avatar

Stephen C Phillips scp93ch

View GitHub Profile
@scp93ch
scp93ch / myservice.py
Last active November 21, 2020 17:15
Example simple Python service with logging
#!/usr/bin/env python
import logging
import logging.handlers
import argparse
import sys
import time # this is only being used as part of the example
# Deafults
LOG_FILENAME = "/tmp/myservice.log"
@scp93ch
scp93ch / myservice.sh
Last active November 21, 2020 17:15
Init script for an interpreted script.This is particularly useful to get simple services written in Python started at boot time.
#!/bin/sh
### BEGIN INIT INFO
# Provides: myservice
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Put a short description of the service here
# Description: Put a long description of the service here