Skip to content

Commit 7bb35af

Browse files
akr2002jsjoeiocode-asher
authored
docs: add OpenRC example (#5266)
Co-authored-by: SIGSEGV <[email protected]> Co-authored-by: Joe Previte <[email protected]> Co-authored-by: Asher <[email protected]>
1 parent f178f04 commit 7bb35af

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.github/CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
* @coder/code-server-reviewers
22

33
ci/helm-chart/ @Matthew-Beckett @alexgorbatchev
4+
5+
docs/install.md @GNUxeava

docs/install.md

+67
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [Debian, Ubuntu](#debian-ubuntu)
1010
- [Fedora, CentOS, RHEL, SUSE](#fedora-centos-rhel-suse)
1111
- [Arch Linux](#arch-linux)
12+
- [Artix Linux](#artix-linux)
1213
- [macOS](#macos)
1314
- [Docker](#docker)
1415
- [Helm](#helm)
@@ -190,6 +191,72 @@ sudo systemctl enable --now code-server@$USER
190191
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
191192
```
192193

194+
## Artix Linux
195+
196+
```bash
197+
# Install code-server from the AUR
198+
git clone https://aur.archlinux.org/code-server.git
199+
cd code-server
200+
makepkg -si
201+
```
202+
203+
Save the file as `code-server` in `/etc/init.d/` and make it executable with `chmod +x code-server`. Put your username in line 3.
204+
205+
```bash
206+
#!/sbin/openrc-run
207+
name=$RC_SVCNAME
208+
description="$name - VS Code on a remote server"
209+
user="" # your username here
210+
homedir="/home/$user"
211+
command="$(which code-server)"
212+
# Just because you can do this does not mean you should. Use ~/.config/code-server/config.yaml instead
213+
#command_args="--extensions-dir $homedir/.local/share/$name/extensions --user-data-dir $homedir/.local/share/$name --disable-telemetry"
214+
command_user="$user:$user"
215+
pidfile="/run/$name/$name.pid"
216+
command_background="yes"
217+
extra_commands="report"
218+
219+
depend() {
220+
use logger dns
221+
need net
222+
}
223+
224+
start_pre() {
225+
checkpath --directory --owner $command_user --mode 0755 /run/$name /var/log/$name
226+
}
227+
228+
start() {
229+
default_start
230+
report
231+
}
232+
233+
stop() {
234+
default_stop
235+
}
236+
237+
status() {
238+
default_status
239+
report
240+
}
241+
242+
report() {
243+
# Report to the user
244+
einfo "Reading configuration from ~/.config/code-server/config.yaml"
245+
}
246+
```
247+
248+
Start on boot with default runlevel
249+
250+
```
251+
rc-update add code-server default
252+
```
253+
254+
Start the service immediately
255+
256+
```
257+
rc-service code-server start
258+
```
259+
193260
## macOS
194261

195262
```bash

0 commit comments

Comments
 (0)