Details
-
Type:
Bug
-
Status: Done
-
Priority:
Low
-
Resolution: Fixed
-
Affects Version/s: 3.11.0
-
Component/s: Promise type: files
-
Labels:None
Description
I am trying to create a permission based promise for a socket file on one of our servers and looks like it cant open the file in safe_open function and safe_chmod and safe_chown always fails
Output (When permission is different from promise):
cf-agent -KI -f ./teste.cf
2014-12-08T18:33:59-0200 error: /default/socket/files/'/root/testsocket'[0]: chmod failed on '/root/testsocket'. (chmod: No such device or address)
Output (When uid is different from promise):
2014-12-08T18:39:21-0200 info: /default/socket/files/'/root/testsocket'[0]: Owner of '/root/testsocket' was 0, setting to 450001
2014-12-08T18:39:21-0200 info: /default/socket/files/'/root/testsocket'[0]: Cannot set ownership on file '/root/testsocket'. (chown: No such device or address)
My test promise:
body perms change_owner(p,u,g) { mode => "${p}"; owners => { "${u}" }; groups => { "${g}" }; } body common control { bundlesequence => { "socket" }; } bundle agent socket { files: "/root/testsocket" perms => change_owner("0775", "root", "root"); }
Our socket:
# stat testsocket File: `testsocket' Size: 0 Blocks: 0 IO Block: 4096 socket Device: fd00h/64768d Inode: 38699027 Links: 1 Access: (0755/srwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2014-12-08 17:25:49.000000000 -0200 Modify: 2014-12-08 17:25:49.000000000 -0200 Change: 2014-12-08 17:29:21.000000000 -0200