Skip to content

gbraad-vscode/code-systemd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Systemd services for code / codium

Run code tunnel, code serve-web or codium serve-web using systemd. This has been part of my devenv installs, code-serveweb-action, and code-tunnel-action actions.

Install Code

target_arch="x64"      # "arm64"
target_path=/usr/bin/  # ~/.local/bin/
tempfile=$(mktemp)
curl -fsSL "https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-${target_arch}" -o ${tempfile}
tar -zxvf ${tempfile} -C ${target_path} > /dev/null 2>&1
rm -f ${tempfile}

Or package (RPM)

target_arch="x64"      # "arm64"
tempfile=$(mktemp)
curl -fsSL "https://code.visualstudio.com/sha/download?build=stable&os=linux-rpm-${target_arch}" -o ${tempfile}.rpm
sudo dnf install -y ${tempfile}.rpm
rm -f ${tempfile}.rpm

Services (system)

sudo curl -fsSL https://raw.githubusercontent.com/gbraad-vscode/code-systemd/refs/heads/main/system/code-serveweb%40.service \
  -o /etc/systemd/system/code-serveweb@.service
sudo curl -fsSL https://raw.githubusercontent.com/gbraad-vscode/code-systemd/refs/heads/main/system/code-tunnel%40.service   \
  -o /etc/systemd/system/code-tunnel@.service
sudo systemctl daemon-reload
sudo systemctl enable --now code-serveweb@${USER}

Services (user)

mkdir -p ~/.config/systemd/user/
curl -fsSL  https://raw.githubusercontent.com/gbraad-vscode/code-systemd/refs/heads/main/user/code-serveweb.service \
  -o ~/.config/systemd/user/code-serveweb.service
curl -fsSL  https://raw.githubusercontent.com/gbraad-vscode/code-systemd/refs/heads/main/user/code-tunnel.service   \
  -o ~/.config/systemd/user/code-tunnel.service
systemctl --user daemon-reload
systemctl --user enable --now code-serveweb

Note

You might need to run loginctl enable-linger ${USER} to allow processes to remain running after you log out.

Install Codium Server

Download the latest version as described in this commit and related issue.

Services (system)

curl -fsSL  https://raw.githubusercontent.com/gbraad-vscode/code-systemd/refs/heads/main/codium-system/codium-server%40.service \
  -o /etc/systemd/system/codium-server@.service
sudo systemctl daemon-reload
sudo systemctl enable --now codium-server@${USER}

Services (user)

mkdir -p ~/.config/systemd/user/
curl -fsSL  https://raw.githubusercontent.com/gbraad-vscode/code-systemd/refs/heads/main/codium-user/codium-server.service \
  -o ~/.config/systemd/user/codium-server.service
systemctl --user daemon-reload
systemctl --user enable --now codium-server

About

Run `code serve-web`, `code tunnel` or `codium-server` using systemd

Resources

Stars

Watchers

Forks