これを実行すると取得debconf: DbDriver \"passwords\" warning: could not open /var/cache/debconf/passwords.dat: Permission denied\ndebconf: DbDriver \"config\": could not write /var/cache/debconf/config.dat-new: Permission denied\n#> [packages]: Packages : FAIL\n"
できます。なんらかの理由でsudoingしていないようです。
(ns localhost.idk
(:require (pallet [compute :as compute]
[api :as api :refer [lift]]
[actions :as actions])))
;; Running this on my local machine
(def my-data-center
(compute/instantiate-provider
"node-list"
:node-list [["localhost" "ed" "127.0.0.1" :ubuntu
:is-64bit nil]]))
(def user-deadghost
(api/make-user "deadghost"
:password "my-pw"
:sudo-password nil)) ; pwless sudo set up
(defn install-ed []
(pallet.api/lift
(pallet.api/group-spec
"ed"
:phases {:configure (api/plan-fn
;; This works:
;; (pallet.actions/exec-script
;; ("sudo aptitude install ed"))
;; This is trying to run without sudo:
(actions/packages :aptitude ["ed"]))})
;; log shows: p.script-builder prefix kw :no-sudo
:compute my-data-center
:user user-deadghost))
実行中のスクリプト:
#!/usr/bin/env bash
mkdir -p /home/deadghost || exit 1
cd /home/deadghost
set -h
echo '[packages]: Packages...';
{
{ debconf-set-selections <<EOF
debconf debconf/frontend select noninteractive
debconf debconf/frontend seen false
EOF
} && enableStart() {
rm /usr/sbin/policy-rc.d
} && apt-get -q -y install ed+ && dpkg --get-selections
} || { echo '#> [packages]: Packages : FAIL'; exit 1;} >&2
echo '#> [packages]: Packages : SUCCESS'
exit $?
私が受け取っているエラーは、debconf
ない部分と一致していsudo
ます。