小编rui*_*imo的帖子

我可以更改IBM容器中装载的目录的所有者吗?

我正在尝试在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)

是否可以更改已挂载目录的所有者?

containers ibm-cloud

8
推荐指数
1
解决办法
1737
查看次数

如何解决Rust中可变引用的生命周期错误?

我不知道为什么下面的代码不能编译.

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)

lifetime rust

2
推荐指数
1
解决办法
839
查看次数

标签 统计

containers ×1

ibm-cloud ×1

lifetime ×1

rust ×1