Created
April 6, 2017 16:15
-
-
Save mabnhdev/121154d3c6fd830d60a60eaee3c33c7b to your computer and use it in GitHub Desktop.
Snappy python daemon problem.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snapcraft.yaml: | |
name: test | |
version: '0.1' | |
summary: Test snappy daemonization | |
description: | | |
This is my-snap's description. You have a paragraph or two to tell the | |
most important story about your snap. Keep it under 100 words though, | |
we live in tweetspace and your description wants to look good in the snap | |
store. | |
grade: devel | |
confinement: devmode | |
apps: | |
test-daemon: | |
command: usr/bin/test-daemon | |
daemon: forking | |
parts: | |
tests: | |
plugin: dump | |
stage-packages: | |
- python-daemon | |
source: src/tests | |
test-daemon: | |
#!/usr/bin/env python | |
import daemon | |
import syslog | |
import time | |
def main(): | |
id = 0 | |
while True: | |
id = id + 1 | |
syslog.syslog(syslog.LOG_INFO, 'id={} hello {}!!!!'.format(id, 'world')) | |
time.sleep(60) | |
with daemon.DaemonContext(): | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment