叨嗒嗵 - wsl
type: channel
link: https://www.dotatong.com/index.php/tag/wsl/
items: Win10子系统Alpine服务管理工具openrc

Win10子系统Alpine服务管理工具openrc
type: item
date: 2020-12-24T04:35:00+00:00
description: 场景win10安装alpine作为linux子系统注意安装完成子系统后，提示输入用户名时，如果只想使用root账号，直接按Ctrl+C终止可选初始配置#!/bin/bash sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories apk update apk add git nginx tzdata openssh-client openssl curl zsh cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime echo "Asia/Shanghai" > /etc/timezone sed -i 's/ash/zsh/g' /etc/passwd sh -c "$(curl -fsSL https://dotatong.cn/tools/oh_my_zsh.sh)" sed -i -e 's/ZSH_THEME=.*/ZSH_THEME="ys"/g' /root/.zshrc服务管理工具类似于centos的systemd，alpine使用openrc来管理服务安装openrcapk add openrc ifupdown⚠️若networking启动不了，需要安装ifupdown改变Runlevelrc default参考：https://www.cyberciti.biz/faq/how-to-enable-and-start-services-on-alpine-linux/添加开机启动rc-update add fsck root localmount networking查看服务状态rc-status rc-status -a rc-status -s启动服务rc-service nginx start停止服务rc-service nginx stop