This commit is contained in:
parent
ec3130e805
commit
0fe16466fc
7 changed files with 76 additions and 0 deletions
3
README.md
Normal file
3
README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
# dwatch
|
||||||
|
|
||||||
|
Отслеживание изменений в файлах.
|
||||||
13
files/config.patch
Normal file
13
files/config.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/source/app.d b/source/app.d
|
||||||
|
index cac73be..3bb7fad 100644
|
||||||
|
--- a/source/app.d
|
||||||
|
+++ b/source/app.d
|
||||||
|
@@ -96,7 +96,7 @@ int main(string[] args)
|
||||||
|
|
||||||
|
ProgramArgs argumets = program.parse(args);
|
||||||
|
|
||||||
|
- string configFile = argumets.option("config", "config.json");
|
||||||
|
+ string configFile = argumets.option("config", "/etc/dwatch/config.json");
|
||||||
|
|
||||||
|
DWConfig config;
|
||||||
|
|
||||||
14
files/config.template.json
Normal file
14
files/config.template.json
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"database": "/var/lib/dwatch/data.db",
|
||||||
|
"logfile": "/var/log/dwatch.log",
|
||||||
|
"timezone": "Europe/Moscow",
|
||||||
|
"watch": [
|
||||||
|
{
|
||||||
|
"path": "",
|
||||||
|
"rules": {
|
||||||
|
"tracking": [],
|
||||||
|
"ignore": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
1
files/dwatch.tmpfiles
Normal file
1
files/dwatch.tmpfiles
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
d /var/lib/dwatch 0755 root root -
|
||||||
15
files/dwatchd.service
Normal file
15
files/dwatchd.service
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
[Unit]
|
||||||
|
Description=DWatch server daemon for monitoring changes in text files and CLI
|
||||||
|
ConditionPathExists=/etc/dwatch/config.json
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/sbin/dwatchd -vvv
|
||||||
|
KillMode=process
|
||||||
|
KillSignal=SIGTERM
|
||||||
|
TimeoutStopSec=10s
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5s
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
1
files/series
Normal file
1
files/series
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
config.patch
|
||||||
29
package.yml
Normal file
29
package.yml
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
name : dwatch
|
||||||
|
version : 0.0.10
|
||||||
|
release : 1
|
||||||
|
source :
|
||||||
|
- git|https://git.zhirov.kz/dwatch/dwatch.git : 35319d42c4bf81583f6978a857b8b0fc41ceb11f
|
||||||
|
homepage : https://git.zhirov.kz/dwatch/dwatch
|
||||||
|
license : BSL-1.0
|
||||||
|
component : system.utils
|
||||||
|
summary : Monitoring changes in text files.
|
||||||
|
description: |
|
||||||
|
Monitoring changes in text files.
|
||||||
|
networking : yes
|
||||||
|
builddeps :
|
||||||
|
- ldc
|
||||||
|
- dub
|
||||||
|
- pkgconfig(xdiff)
|
||||||
|
- pkgconfig(wildmatch)
|
||||||
|
- pkgconfig(sqlite3)
|
||||||
|
setup : |
|
||||||
|
%apply_patches
|
||||||
|
build : |
|
||||||
|
dub build --build=release
|
||||||
|
install : |
|
||||||
|
install -Dm755 bin/dwatch -t ${installdir}/usr/bin
|
||||||
|
# Ссылка на сервис демона
|
||||||
|
ln -sf dwatch ${installdir}/usr/bin/dwatchd
|
||||||
|
install -Dm644 $pkgfiles/config.template.json -t ${installdir}/etc/dwatchd
|
||||||
|
install -Dm644 $pkgfiles/dwatchd.service -t ${installdir}/usr/lib/systemd/system
|
||||||
|
install -Dm00644 $pkgfiles/dwatch.tmpfiles $installdir/%libdir%/tmpfiles.d/dwatch.conf
|
||||||
Loading…
Add table
Add a link
Reference in a new issue