Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: How to autorun? (Read 655 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to autorun?

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
OpenRC services can be started with:
Code: [Select]
# rc-service servicenamehere start

they can be enabled with:
OpenRC services can be started with:
Code: [Select]
# rc-update add servicenamehere runlevel

The default run level is called "default" but you can create other run levels if you desire.
Chris Cromer

Re: How to autorun?

Reply #2
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
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/nginx

then 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/nginx

Make 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
Chris Cromer

Re: How to autorun?

Reply #4
https://gitweb.gentoo.org/repo/gentoo.git/plain/www-servers/nginx/files/nginx.confd and save its contents to /etc/conf.d/nginx

I 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] instead

But fret not, for I will add these to artix repo soon
If I can hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate!

Re: How to autorun?

Reply #5
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 #7
I think what should be saved as /etc/conf.d/nginx is this. That file should be placed in /etc/nginx/nginx.conf instead

But fret not, for I will add these to artix repo soon
No, that is incorrect. The one I linked goes in /etc/conf.d/nginx, the one you linked goes in /etc/nginx/nginx.conf

The one I linked is the configuration for the init script, the one you linked is the configuration for nginx itself.
Chris Cromer

Re: How to autorun?

Reply #8
Okay I messed up :

My initial thought was

confd was put in /etc/conf.d/nginx

nginx.conf-r2 was put in /etc/nginx/nginx.conf

Don't know how it messed up this time, I'm sorry

But anyway I just added both nginx ( no systemd ) and its init scripts on artix testing repo

Enjoy
If I can hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate!