---
title: "设置debian开机运行命令"
url: "https://lerry.me/post/2011/11/settings-of-run-script-on-startup"
date: 2011-11-13T10:35:00.000Z
updated: 2026-08-31T08:41:01.300Z
tags:
  - "Linux"
  - "Debian"
language: zh-CN
---

# 设置debian开机运行命令

Debain testing里面有个官方的uwsgi包，今天想配置一下，弄了好久都不行，只好自己[编译了一个uwsgi](http://projects.unbit.it/uwsgi/wiki/Install)，但是需要设置开机启动，之前弄得那个放在/etc/rc2.d的办法不知道为什么一直不行，后来又看了好多资料，终于找到了办法。

因为我要运行的程序必须在指定目录运行，我写了个文本，内容如下：

```cd /root/myblog3 /root/uwsgi -s :3030 -w blog -M -p 2 -t 30 --limit-as 60 -R 1000 -d /root/uwsgi.log```
