How to fix 'Permission denied error'?

15 views
Skip to first unread message

Anil Wadghule

unread,
Oct 15, 2019, 10:44:06 PM10/15/19
to packe...@googlegroups.com
When I have following config

{
"type": "shell",
"inline":[
"sudo echo '$PreserveFQDN on' >> /etc/rsyslog.d/server.conf”,
]
} ] }

I get this error

==> amazon-ebs: /tmp/script_1019.sh: 27: /tmp/script_1019.sh: cannot create /etc/rsyslog.d/server.conf: Permission denied

I know sudo mv a local file would fix that, but I don’t want to copy whole server.conf locally and move.

cannot create /etc/rsyslog.d/server.conf: Permission denied

Thanks,
Anil

Rickard von Essen

unread,
Oct 16, 2019, 5:16:29 AM10/16/19
to packe...@googlegroups.com
It should be "sudo bash -c 'echo \'$PreserveFQDN on\' >> /etc/rsyslog.d/server.conf'" 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/7F5A79E0-003D-4986-9087-F78BE0A0A529%40gmail.com.
Reply all
Reply to author
Forward
0 new messages