mirror of https://github.com/MISP/misp-packer
				
				
				
			Do not start workers with systemd.
							parent
							
								
									c96c11fbac
								
							
						
					
					
						commit
						36efe24562
					
				| 
						 | 
					@ -264,8 +264,8 @@ EOF
 | 
				
			||||||
sudo chown -R www-data:www-data $PATH_TO_MISP/app/Config
 | 
					sudo chown -R www-data:www-data $PATH_TO_MISP/app/Config
 | 
				
			||||||
sudo chmod -R 750 $PATH_TO_MISP/app/Config
 | 
					sudo chmod -R 750 $PATH_TO_MISP/app/Config
 | 
				
			||||||
# Set some MISP directives with the command line tool
 | 
					# Set some MISP directives with the command line tool
 | 
				
			||||||
$PATH_TO_MISP/app/Console/cake Baseurl $MISP_BASEURL
 | 
					sudo $PATH_TO_MISP/app/Console/cake Baseurl $MISP_BASEURL
 | 
				
			||||||
$PATH_TO_MISP/app/Console/cake Live $MISP_LIVE
 | 
					sudo $PATH_TO_MISP/app/Console/cake Live $MISP_LIVE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo -e "\n--- Generating a GPG encryption key... ---\n"
 | 
					echo -e "\n--- Generating a GPG encryption key... ---\n"
 | 
				
			||||||
| 
						 | 
					@ -294,20 +294,30 @@ sudo -u www-data gpg --homedir $PATH_TO_MISP/.gnupg --batch --gen-key gen-key-sc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo -e "\n--- Making the background workers start on boot... ---\n"
 | 
					echo -e "\n--- Making the background workers start on boot... ---\n"
 | 
				
			||||||
sudo chmod 755 $PATH_TO_MISP/app/Console/worker/start.sh
 | 
					sudo chmod 755 $PATH_TO_MISP/app/Console/worker/start.sh
 | 
				
			||||||
sudo cat > /etc/systemd/system/workers.service  <<EOF
 | 
					# With systemd:
 | 
				
			||||||
[Unit]
 | 
					# sudo cat > /etc/systemd/system/workers.service  <<EOF
 | 
				
			||||||
Description=Start the background workers at boot
 | 
					# [Unit]
 | 
				
			||||||
 | 
					# Description=Start the background workers at boot
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# [Service]
 | 
				
			||||||
 | 
					# Type=forking
 | 
				
			||||||
 | 
					# User=www-data
 | 
				
			||||||
 | 
					# ExecStart=$PATH_TO_MISP/app/Console/worker/start.sh
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# [Install]
 | 
				
			||||||
 | 
					# WantedBy=multi-user.target
 | 
				
			||||||
 | 
					# EOF
 | 
				
			||||||
 | 
					# sudo systemctl enable workers.service > /dev/null
 | 
				
			||||||
 | 
					# sudo systemctl restart workers.service > /dev/null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Service]
 | 
					# With initd:
 | 
				
			||||||
Type=forking
 | 
					if [ ! -e /etc/rc.local ]
 | 
				
			||||||
User=www-data
 | 
					then
 | 
				
			||||||
ExecStart=$PATH_TO_MISP/app/Console/worker/start.sh
 | 
					    echo '#!/bin/sh -e' | sudo tee -a /etc/rc.local
 | 
				
			||||||
 | 
					    echo 'exit 0' | sudo tee -a /etc/rc.local
 | 
				
			||||||
[Install]
 | 
					    sudo chmod u+x /etc/rc.local
 | 
				
			||||||
WantedBy=multi-user.target
 | 
					fi
 | 
				
			||||||
EOF
 | 
					sudo sed -i -e '$i \sudo -u www-data bash /var/www/MISP/app/Console/worker/start.sh\n' /etc/rc.local
 | 
				
			||||||
sudo systemctl enable workers.service > /dev/null
 | 
					 | 
				
			||||||
sudo systemctl restart workers.service > /dev/null
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# echo -e "\n--- Installing MISP modules... ---\n"
 | 
					# echo -e "\n--- Installing MISP modules... ---\n"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue