PM2 docs have a section for start on reboot, it creates a service based on 
the system service manager.
https://pm2.keymetrics.io/docs/usage/startup/
El Wednesday, January 17, 2024 a la(s) 10:42:04 AM UTC-3, Alan Orth 
escribió:

> Dear Joshua,
>
> I am starting pm2 via a systemd service unit, 
> /etc/systemd/system/dspace-angular.service:
>
> [Unit]
> Description=DSpace Angular (PM2)
> After=network.target tomcat9.service
> Wants=tomcat9.service
>
> [Service]
> User=dspace
> Group=dspace
> LimitNOFILE=infinity
> LimitNPROC=infinity
> LimitCORE=infinity
> Environment=NODE_ENV=production
> Environment=PM2_HOME=/home/dspace/.pm2
> Restart=on-failure
> WorkingDirectory=/home/dspace/src/git/dspace-angular
> ExecStart=/home/dspace/.node_modules/lib/node_modules/pm2/bin/pm2 start 
> ./dist/server/main.js --name dspace-ui -i 4 --no-daemon
> ExecReload=/home/dspace/.node_modules/lib/node_modules/pm2/bin/pm2 reload 
> dspace-ui
> ExecStop=/home/dspace/.node_modules/lib/node_modules/pm2/bin/pm2 stop 
> dspace-ui
> # Don't log pm2 to the systemd journal! Use pm2 logs instead.
> StandardOutput=null
>
> [Install]
> WantedBy=multi-user.target
>
> Then start and enable the service like you would any other system service. 
> Works well, but I'm surprised at how pm2 makes this difficult. I find pm2's 
> ergonomics very strange. In the service file above you can see I tell pm2 
> to not start its own management daemon. How can so much of the insanely 
> massive Node.js ecosystem depend on this random package for clustering? And 
> how can there be no other alternatives? Bizarre...
>
> Hope that helps,
>
> On Tue, Jan 9, 2024 at 12:15 AM Joshua Kim <jos...@udel.edu> wrote:
>
>> Hello,
>>
>> Does anyone use automatic start for dspace front end at reboot by using 
>> service ? If so, would you share with us? The 7.x documentation shows only 
>> manual start like pm2 start dspace-ui.json. 
>>
>> -- 
>> All messages to this mailing list should adhere to the Code of Conduct: 
>> https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "DSpace Technical Support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to dspace-tech...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dspace-tech/2b8f0685-8327-4eac-9f0e-683c7d8c22ben%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/dspace-tech/2b8f0685-8327-4eac-9f0e-683c7d8c22ben%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
> Alan Orth
> alan...@gmail.com
> https://picturingjordan.com
> https://englishbulgaria.net
> https://mjanja.ch
>

-- 
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/5079a634-d6a3-49a1-9126-57792f19738en%40googlegroups.com.

Reply via email to