How to autorun? 12 December 2017, 10:49:14 I've put Artix as my home server OS with the aim of retiring the TomatoWRT router and installed the usual server stuff like nginx and php. I noticed that when restarting the box they do not autorun by themselves. What would be the correct way to achieve that? Do I write an OpenRC service file and add it to a runlevel? I could use some pointers to the right info.
Re: How to autorun? Reply #1 – 12 December 2017, 17:54:18 OpenRC services can be started with:Code: [Select]# rc-service servicenamehere startthey can be enabled with:OpenRC services can be started with:Code: [Select]# rc-update add servicenamehere runlevelThe default run level is called "default" but you can create other run levels if you desire.
Re: How to autorun? Reply #2 – 12 December 2017, 20:36:52 The thing is nothing like an nginx service or php service was created when installing the packages, and that's where my question comes in - do I make the service files on my own? Or are there other, maybe more proper mechanisms to make things autostart?
Re: How to autorun? Reply #3 – 12 December 2017, 21:00:00 In this case, it is because the service script is not yet in our repos. What you can do is download the init file:https://gitweb.gentoo.org/repo/gentoo.git/plain/www-servers/nginx/files/nginx.initd-r4 and save its contents to /etc/init.d/nginxthen download the conf file:https://gitweb.gentoo.org/repo/gentoo.git/plain/www-servers/nginx/files/nginx.confd and save its contents to /etc/conf.d/nginxMake sure the chmod /etc/init.d/nginx as 755 to allow it to be executed. After that you can start it with the same commands I posted previously such as:Code: [Select]# rc-service nginx start
Re: How to autorun? Reply #4 – 12 December 2017, 21:57:18 Quote from: cromer – on 12 December 2017, 21:00:00https://gitweb.gentoo.org/repo/gentoo.git/plain/www-servers/nginx/files/nginx.confd and save its contents to /etc/conf.d/nginxI think what should be saved as /etc/conf.d/nginx is [https://gitweb.gentoo.org/repo/gentoo.git/plain/www-servers/nginx/files/nginx.confd[/i] insteadBut fret not, for I will add these to artix repo soon Last Edit: 13 December 2017, 01:40:18 by thefallenrat
Re: How to autorun? Reply #5 – 12 December 2017, 22:51:37 Thank you both. thefallenrat, I'm not sure what you meant, as the file in your link seems to have the same contents as cromer's, neverthless I've put the files in (i hope) right places, checked the privileges and all seems to work. Nginx's config is not a problem.Is it safe to assume that if a package does not come with service files then they can be taken from gentoo if needed?
Re: How to autorun? Reply #6 – 13 December 2017, 00:41:39 Quote from: Everyone – on 12 December 2017, 22:51:37I'm not sure what you meant, as the file in your link seems to have the same contents as cromer's, Wrong link, I meant this https://gitweb.gentoo.org/repo/gentoo.git/plain/www-servers/nginx/files/nginx.conf-r2
Re: How to autorun? Reply #7 – 13 December 2017, 01:14:29 Quote from: thefallenrat – on 12 December 2017, 21:57:18I think what should be saved as /etc/conf.d/nginx is this. That file should be placed in /etc/nginx/nginx.conf insteadBut fret not, for I will add these to artix repo soonNo, that is incorrect. The one I linked goes in /etc/conf.d/nginx, the one you linked goes in /etc/nginx/nginx.confThe one I linked is the configuration for the init script, the one you linked is the configuration for nginx itself.
Re: How to autorun? Reply #8 – 13 December 2017, 01:38:33 Okay I messed up : My initial thought was confd was put in /etc/conf.d/nginxnginx.conf-r2 was put in /etc/nginx/nginx.confDon't know how it messed up this time, I'm sorryBut anyway I just added both nginx ( no systemd ) and its init scripts on artix testing repoEnjoy