小编Raz*_*een的帖子

无法启动redis.service:单元redis-server.service被屏蔽

我在ubuntu 16.04上安装了Redis服务器.但当我尝试启动(sudo systemctl启动redis)redis服务我收到消息.

无法启动redis.service:单元redis-server.service被屏蔽.

我对这个错误一无所知.

redis servicestack.redis devops ubuntu-16.04

20
推荐指数
3
解决办法
3万
查看次数

chrome 扩展中的后台脚本究竟何时运行?

在我的 chrome 扩展中,我有一个后台脚本,它将使用XMLHttpRequest.

// note that this code is in the global scope i.e. outside of any function
// also note that I got this code from the page talking about XMLHttpRequest
var myData = [];

var xhr = new XMLHttpRequest();
xhr.onreadystatechange = handleStateChange;
xhr.open("GET", "...", true);
xhr.send();

function handleStateChange() {
  myData = Object.values(JSON.parse(xhr.responseText));
}
Run Code Online (Sandbox Code Playgroud)

我想知道什么时候xor.send()运行。

我观察到每次我通过按 在此处输入图片说明按钮,xhr.send()将被调用。我还观察到打开新选项卡/窗口不会导致后台脚本再次运行。

我还发现这个页面,后台页面被“加载”和“卸载”,但它几乎没有说明后台脚本全局范围内的代码何时运行。

它是否仅在安装/重新加载扩展时运行?

javascript google-chrome-extension

6
推荐指数
1
解决办法
1132
查看次数

shell 脚本内的 perl -p -i -e

#!/usr/bin/env bash
DOCUMENT_ROOT=/var/www/html/

rm index.php
cd modules/mymodules/

perl -p -i -e 's/x.xx.xx.y/dd.dd.ddd.dd/g' `grep -ril y.yy.yy.y *`
Run Code Online (Sandbox Code Playgroud)

显示 显示警告

-i used with no filenames on the command line, reading from STDIN.
Run Code Online (Sandbox Code Playgroud)

它阻止运行其余脚本。

有什么解决办法吗?

其实我需要跑步

perl -p -i -e 's/x.xx.xx.y/dd.dd.ddd.dd/g' `grep -ril y.yy.yy.y *`
Inside a shell script
Run Code Online (Sandbox Code Playgroud)

我正在使用 ubuntu 和 docker。

linux bash shell perl docker

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

Docker 使用 entrypoint.sh 传递参数 Docker 入口点

我试图将一个参数传递给我的 docker 入口点,但它失败了,这些是我遵循的步骤

Docker Build Command : docker build -t "DBDNS" --build-arg  db=sample
Run Code Online (Sandbox Code Playgroud)

在 Dockerfile 中

ARG db
ENV database ${db}
ENTRYPOINT ["/docker/entrypoint.sh", ${db}]
Run Code Online (Sandbox Code Playgroud)

此 bash 的错误:1: bash: [/var/www/html/.docker/entrypoint.sh,: not found

实际上文件存在并为 entrypoint.sh 传递参数导致问题。任何线索

-----------ENTRYPOINT---------------------
#!/usr/bin/env bash

echo "Entrypoint stuff"
echo "----------------"
echo "NEW APP DB CLONE FROM  $1"
echo "sites/files permission changes"
echo "--------------------------------------"
Run Code Online (Sandbox Code Playgroud)

docker devops

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