sudo use

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: Kevin Brown
日付:  
題目: sudo use
> anyone know how with su or sudo to set the home directory to be something
> other than what is in /etc/passwd or the executing PWD? Specifically in
> an init script starting a service as an alternative user such as webapp


I would think adding the HOME= variable to the head of the script would do that.

e.g.

#!/bin/bash
HOME=/opt/home/apache
cd
./command