Login class for i2pd is added in separate file in /etc/login.conf.d if OpenBSD 7.1 or newer
このコミットが含まれているのは:
コミット
5f016aee39
14
Makefile
14
Makefile
|
@ -1,4 +1,5 @@
|
||||||
.PHONY: install uninstall
|
.PHONY: install uninstall
|
||||||
|
CLASS_FILE = /etc/login.conf.d/i2pd
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# This command verifies if the group _i2pd exists. If it doesn't, it
|
# This command verifies if the group _i2pd exists. If it doesn't, it
|
||||||
|
@ -18,6 +19,16 @@ install:
|
||||||
-c "i2pd account" -d /var/lib/i2pd -s /sbin/nologin _i2pd
|
-c "i2pd account" -d /var/lib/i2pd -s /sbin/nologin _i2pd
|
||||||
chown -R _i2pd:_i2pd /var/lib/i2pd
|
chown -R _i2pd:_i2pd /var/lib/i2pd
|
||||||
|
|
||||||
|
# This command adds a new login class allowing _i2pd to open more files
|
||||||
|
# simultaneously if the version of OpenBSD is 7.1 or newer. For older
|
||||||
|
# versions, the modification should be done manually in /etc/login.conf.
|
||||||
|
if [ $$(echo "$$(uname -r) >= 7.1" | bc) = 1 ]; then \
|
||||||
|
echo "i2pd:\\" > $(CLASS_FILE); \
|
||||||
|
echo "\t:openfiles-cur=102400:\\" >> $(CLASS_FILE); \
|
||||||
|
echo "\t:openfiles-max=102400:\\" >> $(CLASS_FILE); \
|
||||||
|
echo "\t:tc=daemon:" >> $(CLASS_FILE); \
|
||||||
|
fi
|
||||||
|
|
||||||
# This command copies the RC script in the RC script folder to allow
|
# This command copies the RC script in the RC script folder to allow
|
||||||
# I2Pd to be managed by the service supervisor.
|
# I2Pd to be managed by the service supervisor.
|
||||||
install -o root -g bin -m 555 i2pd /etc/rc.d/i2pd
|
install -o root -g bin -m 555 i2pd /etc/rc.d/i2pd
|
||||||
|
@ -29,6 +40,9 @@ uninstall:
|
||||||
rcctl disable i2pd
|
rcctl disable i2pd
|
||||||
rm /etc/rc.d/i2pd
|
rm /etc/rc.d/i2pd
|
||||||
|
|
||||||
|
# This command removes the i2pd login class.
|
||||||
|
rm $(CLASS_FILE)
|
||||||
|
|
||||||
# This command removes the _i2pd user and its home.
|
# This command removes the _i2pd user and its home.
|
||||||
userdel -r _i2pd
|
userdel -r _i2pd
|
||||||
|
|
||||||
|
|
15
README.md
15
README.md
|
@ -77,28 +77,33 @@ this number to a value that is too low for I2Pd to work properly. Symptoms of a
|
||||||
number that is too small include difficulties connecting to eepsites and high
|
number that is too small include difficulties connecting to eepsites and high
|
||||||
CPU usage.
|
CPU usage.
|
||||||
|
|
||||||
To create a login class, simply add the following lines at the end of
|
If you are using OpenBSD 7.0 or older, simply add the following lines at the
|
||||||
`/etc/login.conf`:
|
end of `/etc/login.conf` to create the login class:
|
||||||
|
|
||||||
i2pd:\
|
i2pd:\
|
||||||
:openfiles-cur=102400:\
|
:openfiles-cur=102400:\
|
||||||
:openfiles-max=102400:\
|
:openfiles-max=102400:\
|
||||||
:tc=daemon:
|
:tc=daemon:
|
||||||
|
|
||||||
This login class will be used by the user `_i2pd` created in the following
|
If you are using OpenBSD 7.1 or newer, a login class can be created by adding a
|
||||||
|
file in `/etc/login.conf.d`. The makefile ran in the next steps detects the
|
||||||
|
version and creates the file automatically.
|
||||||
|
|
||||||
|
The new login class will be used by the user `_i2pd` created in the following
|
||||||
steps. Next, clone this git repository:
|
steps. Next, clone this git repository:
|
||||||
|
|
||||||
$ cd /a/folder/of/your/choice/where/to/clone/the/repo
|
$ cd /a/folder/of/your/choice/where/to/clone/the/repo
|
||||||
$ git clone https://gitlab.com/alpou/i2pd-rc-openbsd.git
|
$ git clone https://gitlab.com/alpou/i2pd-rc-openbsd.git
|
||||||
|
|
||||||
Then, simply run the makefile. This step creates a dedicated `_i2pd` user and a
|
Then, simply run the makefile. This step creates a dedicated `_i2pd` user and a
|
||||||
group of the same name if they don't already exist, makes the binaries
|
group of the same name if they don't already exist, creates the login class
|
||||||
|
described above if you are using OpenBSD 7.1 or newer, makes the binaries
|
||||||
previously compiled belong to them, and copies the init script in `/etc/rc.d`.
|
previously compiled belong to them, and copies the init script in `/etc/rc.d`.
|
||||||
|
|
||||||
$ cd i2pd-rc-openbsd
|
$ cd i2pd-rc-openbsd
|
||||||
$ doas make install
|
$ doas make install
|
||||||
|
|
||||||
The final step is to enable the service to make it start at boot time and
|
The final step is to enable the service to make it start at boot time and to
|
||||||
manually start it:
|
manually start it:
|
||||||
|
|
||||||
$ doas rcctl enable i2pd
|
$ doas rcctl enable i2pd
|
||||||
|
|
読み込み中…
新しいイシューから参照