我正在尝试在IBM容器中启动postgres.我刚创建了以下卷:
$ cf ic volume create pgdata
Run Code Online (Sandbox Code Playgroud)
然后安装它:
$ cf ic run --volume pgdata:/var/pgsql -p 22 registry.ng.bluemix.net/ruimo/pgsql944-cli
Run Code Online (Sandbox Code Playgroud)
通过ssh登录到容器后,我发现挂载的目录由root拥有:
drwxr-xr-x 3 root root 4096 Jul 8 08:20 pgsql
Run Code Online (Sandbox Code Playgroud)
由于postgres不允许以root身份运行,我想更改此目录的所有者.但是我无法更改此目录的所有者:
# chown postgres:postgres pgsql
chown: changing ownership of 'pgsql': Permission denied
Run Code Online (Sandbox Code Playgroud)
是否可以更改已挂载目录的所有者?
我不知道为什么下面的代码不能编译.
use std::cmp::Ordering;
struct MyItr<'a> {
cur: &'a i32,
}
impl<'a> Ord for MyItr<'a> {
fn cmp(&self, other: &MyItr) -> Ordering {
self.cur.cmp(&other.cur)
}
}
impl<'a> PartialOrd for MyItr<'a> {
fn partial_cmp(&self, other: &MyItr<'a>) -> Option<Ordering> {
Some(self.cmp(other))
}
}
impl<'a> PartialEq for MyItr<'a> {
fn eq(&self, other: &MyItr) -> bool {
self.cur == other.cur
}
}
impl<'a> Eq for MyItr<'a> {}
fn f0<'a>(t0: &'a mut MyItr<'a>, t1: &'a mut MyItr<'a>, i: &'a i32) {
let t = std::cmp::max(t0, t1); …Run Code Online (Sandbox Code Playgroud)