install script
parent
6e3c0a758e
commit
01bcb2fc74
|
@ -2,6 +2,12 @@
|
||||||
cp pysmtp-server.service /etc/systemd/system/pysmtp-server.service
|
cp pysmtp-server.service /etc/systemd/system/pysmtp-server.service
|
||||||
cp pysmtp-sender.service /etc/systemd/system/pysmtp-sender.service
|
cp pysmtp-sender.service /etc/systemd/system/pysmtp-sender.service
|
||||||
|
|
||||||
|
mkdir -p /var/log/pysmtp-sender
|
||||||
|
mkdir -p /var/log/pysmtp-server
|
||||||
|
|
||||||
|
cp -f pysmtp.conf /etc/logrotate.d/pysmtp.conf
|
||||||
|
chmod 644 /etc/logrotate.d/pysmtp.conf
|
||||||
|
|
||||||
systemctl unmask pysmtp-server.service
|
systemctl unmask pysmtp-server.service
|
||||||
systemctl enable pysmtp-server.service
|
systemctl enable pysmtp-server.service
|
||||||
systemctl start pysmtp-server.service
|
systemctl start pysmtp-server.service
|
||||||
|
@ -9,3 +15,5 @@ systemctl start pysmtp-server.service
|
||||||
systemctl unmask pysmtp-sender.service
|
systemctl unmask pysmtp-sender.service
|
||||||
systemctl enable pysmtp-sender.service
|
systemctl enable pysmtp-sender.service
|
||||||
systemctl start pysmtp-sender.service
|
systemctl start pysmtp-sender.service
|
||||||
|
|
||||||
|
systemctl restart logrotate
|
||||||
|
|
|
@ -6,6 +6,8 @@ After=multi-user.target
|
||||||
Type=simple
|
Type=simple
|
||||||
Restart=always
|
Restart=always
|
||||||
ExecStart=/usr/bin/python3 /srv/sender.py
|
ExecStart=/usr/bin/python3 /srv/sender.py
|
||||||
|
StandardOutput=append:/var/log/pysmtp-sender/messages.log
|
||||||
|
StandardError=append:/var/log/pysmtp-sender/errors.log
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
|
@ -6,6 +6,8 @@ After=multi-user.target
|
||||||
Type=simple
|
Type=simple
|
||||||
Restart=always
|
Restart=always
|
||||||
ExecStart=/usr/bin/python3 /srv/server.py
|
ExecStart=/usr/bin/python3 /srv/server.py
|
||||||
|
StandardOutput=append:/var/log/pysmtp-server/messages.log
|
||||||
|
StandardError=append:/var/log/pysmtp-server/errors.log
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
|
@ -0,0 +1,9 @@
|
||||||
|
/var/log/pysmtp-server/*.log /var/log/pysmtp-sender/*.log {
|
||||||
|
daily
|
||||||
|
missingok
|
||||||
|
rotate 90
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
notifempty
|
||||||
|
dateext
|
||||||
|
}
|
Loading…
Reference in New Issue