File: daemon_chdir.py

package info (click to toggle)
python-daemonize 2.5.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 200 kB
  • sloc: python: 416; makefile: 32
file content (18 lines) | stat: -rw-r--r-- 302 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python3

from sys import argv

from daemonize import Daemonize

pid = argv[1]
working_dir = argv[2]
file_name = argv[3]


def main():
    with open(file_name, "w") as f:
        f.write("test")


daemon = Daemonize(app="test_app", pid=pid, action=main, chdir=working_dir)
daemon.start()