May 232016
 

this is how to set maximum number of open file and maximum number of processess on systemd startup script. for example you want give nginx process nofile 20000 and nproc unlimited.

edit nginx.service file

#vi /etc/systemd/system/multi-user.target.wants/nginx.service

add these into [Service] section

LimitNOFILE=20000
LimitNPROC=-1

reload the systemd script daemon

#systemctl daemon-reload

finally, restart nginx service, and you’re done.

#systemctl restart nginx.service
Share
May 102016
 

required: inotify-tools

first create this bash script, let’s name it as transport.sh

#!/bin/bash
while true; do
	inotifywait -e modify /etc/postfix/transport
	postmap hash:/etc/postfix/transport
done

make it executable

chmod 755 transport.sh

run the script

./transport.sh > /dev/null 2>&1&

this script will stay on background proccess.

try modify transport file

dd.com smtp:[x.x.x.x]:25
ee.com smtp:[x.x.x.x]:25

save it, and test it

postmap -q ee.com hash:/etc/postfix/transport
smtp:[x.x.x.x]:25

enjoy

Share