Skip to content

Add OpenRC support #5266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* @coder/code-server-reviewers

ci/helm-chart/ @Matthew-Beckett @alexgorbatchev

docs/install.md @GNUxeava
67 changes: 67 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [Debian, Ubuntu](#debian-ubuntu)
- [Fedora, CentOS, RHEL, SUSE](#fedora-centos-rhel-suse)
- [Arch Linux](#arch-linux)
- [Artix Linux](#artix-linux)
- [macOS](#macos)
- [Docker](#docker)
- [Helm](#helm)
Expand Down Expand Up @@ -190,6 +191,72 @@ sudo systemctl enable --now code-server@$USER
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
```

## Artix Linux

```bash
# Install code-server from the AUR
git clone https://aur.archlinux.org/code-server.git
cd code-server
makepkg -si
```

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.

```bash
#!/sbin/openrc-run
name=$RC_SVCNAME
description="$name - VS Code on a remote server"
user="" # your username here
homedir="/home/$user"
command="$(which code-server)"
# Just because you can do this does not mean you should. Use ~/.config/code-server/config.yaml instead
#command_args="--extensions-dir $homedir/.local/share/$name/extensions --user-data-dir $homedir/.local/share/$name --disable-telemetry"
command_user="$user:$user"
pidfile="/run/$name/$name.pid"
command_background="yes"
extra_commands="report"

depend() {
use logger dns
need net
}

start_pre() {
checkpath --directory --owner $command_user --mode 0755 /run/$name /var/log/$name
}

start() {
default_start
report
}

stop() {
default_stop
}

status() {
default_status
report
}

report() {
# Report to the user
einfo "Reading configuration from ~/.config/code-server/config.yaml"
}
```

Start on boot with default runlevel

```
rc-update add code-server default
```

Start the service immediately

```
rc-service code-server start
```

## macOS

```bash
Expand Down