summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2017-04-18 22:07:01 +0200
committerSebastian Reichel <sre@ring0.de>2017-04-18 22:08:34 +0200
commit529d6dd34f9209efef18c04121075be9ac310c9c (patch)
tree7c131fa440df3805348930f5cfa204fd4316550e
parenta211b960a7590910b46c1d59acaeda5e87b5b522 (diff)
downloadserial-barcode-scanner-529d6dd34f9209efef18c04121075be9ac310c9c.tar.bz2
add systemd files
-rw-r--r--systemd/shopsystem-input-device.rules1
-rw-r--r--systemd/shopsystem-input-device.service20
-rw-r--r--systemd/shopsystem-mail-backup.service12
-rw-r--r--systemd/shopsystem-mail-backup.timer9
-rw-r--r--systemd/shopsystem-mail-daily-invoice.service13
-rw-r--r--systemd/shopsystem-mail-daily-invoice.timer9
-rw-r--r--systemd/shopsystem-mail-monthly-invoice.service13
-rw-r--r--systemd/shopsystem-mail-monthly-invoice.timer9
-rw-r--r--systemd/shopsystem-ui.service14
-rw-r--r--systemd/shopsystem-web.service15
10 files changed, 115 insertions, 0 deletions
diff --git a/systemd/shopsystem-input-device.rules b/systemd/shopsystem-input-device.rules
new file mode 100644
index 0000000..7e6bfa2
--- /dev/null
+++ b/systemd/shopsystem-input-device.rules
@@ -0,0 +1 @@
+ACTION=="add", ATTRS{idVendor}=="0536", ATTRS{idProduct}=="02e1", MODE="0666", SYMLINK+="barcodescanner" TAG+="systemd", ENV{SYSTEMD_WANTS}="shopsystem-input-device"
diff --git a/systemd/shopsystem-input-device.service b/systemd/shopsystem-input-device.service
new file mode 100644
index 0000000..3fec267
--- /dev/null
+++ b/systemd/shopsystem-input-device.service
@@ -0,0 +1,20 @@
+[Unit]
+Description=Shop System Input Device Handler
+BindsTo=dev-barcodescanner.device
+Requires=dev-barcodescanner.device
+After=dev-barcodescanner.device
+
+[Service]
+Type=dbus
+BusName=io.mainframe.shopsystem.InputDevice
+User=shop
+Group=shop
+Restart=always
+RestartSec=10
+ExecStart=/home/shop/serial-barcode-scanner/src/input-device/input-device
+StandardInput=tty
+StandardOutput=tty
+TTYPath=/dev/tty3
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/shopsystem-mail-backup.service b/systemd/shopsystem-mail-backup.service
new file mode 100644
index 0000000..9521242
--- /dev/null
+++ b/systemd/shopsystem-mail-backup.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Send shopsystem backup mail
+DefaultDependencies=no
+Conflicts=shutdown.target
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+User=shop
+Group=shop
+ExecStart=/home/shop/serial-barcode-scanner/src/backup/backup
+IOSchedulingClass=idle
diff --git a/systemd/shopsystem-mail-backup.timer b/systemd/shopsystem-mail-backup.timer
new file mode 100644
index 0000000..b0c18a2
--- /dev/null
+++ b/systemd/shopsystem-mail-backup.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Run shopsystem backup mail daily
+
+[Timer]
+OnCalendar=*-*-* 08:00:00
+Persistent=true
+
+[Install]
+WantedBy=timers.target
diff --git a/systemd/shopsystem-mail-daily-invoice.service b/systemd/shopsystem-mail-daily-invoice.service
new file mode 100644
index 0000000..3cce03e
--- /dev/null
+++ b/systemd/shopsystem-mail-daily-invoice.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Send shopsystem daily invoice mail
+DefaultDependencies=no
+Conflicts=shutdown.target
+
+[Service]
+Type=oneshot
+User=shop
+Group=shop
+ExecStart=/home/shop/serial-barcode-scanner/src/invoice/invoice temporary
+StandardOutput=journal
+StandardError=journal
+IOSchedulingClass=idle
diff --git a/systemd/shopsystem-mail-daily-invoice.timer b/systemd/shopsystem-mail-daily-invoice.timer
new file mode 100644
index 0000000..8688d03
--- /dev/null
+++ b/systemd/shopsystem-mail-daily-invoice.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Send shopsystem daily invoice
+
+[Timer]
+OnCalendar=*-*-* 08:15:00
+Persistent=true
+
+[Install]
+WantedBy=timers.target
diff --git a/systemd/shopsystem-mail-monthly-invoice.service b/systemd/shopsystem-mail-monthly-invoice.service
new file mode 100644
index 0000000..dd217b3
--- /dev/null
+++ b/systemd/shopsystem-mail-monthly-invoice.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Send shopsystem monthly invoice mail
+DefaultDependencies=no
+Conflicts=shutdown.target
+
+[Service]
+Type=oneshot
+User=shop
+Group=shop
+ExecStart=/home/shop/serial-barcode-scanner/src/invoice/invoice final
+StandardOutput=journal
+StandardError=journal
+IOSchedulingClass=idle
diff --git a/systemd/shopsystem-mail-monthly-invoice.timer b/systemd/shopsystem-mail-monthly-invoice.timer
new file mode 100644
index 0000000..a29d964
--- /dev/null
+++ b/systemd/shopsystem-mail-monthly-invoice.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Send shopsystem monthly invoice
+
+[Timer]
+OnCalendar=*-*-01 09:00:00
+Persistent=true
+
+[Install]
+WantedBy=timers.target
diff --git a/systemd/shopsystem-ui.service b/systemd/shopsystem-ui.service
new file mode 100644
index 0000000..72a5e86
--- /dev/null
+++ b/systemd/shopsystem-ui.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Shop System UI
+
+[Service]
+User=shop
+Group=shop
+Type=simple
+ExecStart=/home/shop/serial-barcode-scanner/src/curses-ui/curses-ui
+StandardInput=tty
+StandardOutput=tty
+TTYPath=/dev/tty3
+
+[Install]
+WantedBy=multi-user.target
diff --git a/systemd/shopsystem-web.service b/systemd/shopsystem-web.service
new file mode 100644
index 0000000..f29cfd4
--- /dev/null
+++ b/systemd/shopsystem-web.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Shop System Web Interface
+Requires=shopsystem-dbus.service
+After=shopsystem-dbus.service
+
+[Service]
+User=shop
+Group=shop
+Type=simple
+ExecStart=/home/shop/serial-barcode-scanner/src/web/web
+StandardInput=null
+StandardOutput=journal
+
+[Install]
+WantedBy=multi-user.target