S
S
Sergey Pugovkin2019-09-26 16:04:12
linux
Sergey Pugovkin, 2019-09-26 16:04:12

Very strange sed behavior on Heroku!?

I have a docker container with a simple project, git push it to Heroku.
Recently, sed began to behave very strangely.
After this command:

sed -i -e "s/\$PORT/${PORT:-8080}/g" /etc/nginx/sites.conf'

The file becomes unreadable, although the owner and permissions remain the same. Through chmod it turns out to set the rights (and it is enough to set any with reading) and the file is again available for reading. But after running sed again, the file is inaccessible, even if the permissions on the file are 0777.
This option does not cause problems:
sed "s/\$PORT/${PORT:-8080}/g" /etc/nginx/sites_original.conf > /etc/nginx/sites.conf'

That is, if sed does not replace the file in place, then there is no problem.
Why is this happening? It didn't happen before...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
ValdikSS, 2019-10-23
@Driver86

Apparently, this is how the umask is configured.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question