{"action":"created","issue":{"url":"https://api.github.com/repos/sysrepo/sysrepo/issues/281","repository_url":"https://api.github.com/repos/sysrepo/sysrepo","labels_url":"https://api.github.com/repos/sysrepo/sysrepo/issues/281/labels{/name}","comments_url":"https://api.github.com/repos/sysrepo/sysrepo/issues/281/comments","events_url":"https://api.github.com/repos/sysrepo/sysrepo/issues/281/events","html_url":"https://github.com/sysrepo/sysrepo/issues/281","id":170555701,"number":281,"title":"When application sub a module only with argument parameters ,it failed at first time of the application start up ,when the application start again it success.","user":{"login":"ZhaoGuangYue","id":16473628,"avatar_url":"https://avatars.githubusercontent.com/u/16473628?v=3","gravatar_id":"","url":"https://api.github.com/users/ZhaoGuangYue","html_url":"https://github.com/ZhaoGuangYue","followers_url":"https://api.github.com/users/ZhaoGuangYue/followers","following_url":"https://api.github.com/users/ZhaoGuangYue/following{/other_user}","gists_url":"https://api.github.com/users/ZhaoGuangYue/gists{/gist_id}","starred_url":"https://api.github.com/users/ZhaoGuangYue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZhaoGuangYue/subscriptions","organizations_url":"https://api.github.com/users/ZhaoGuangYue/orgs","repos_url":"https://api.github.com/users/ZhaoGuangYue/repos","events_url":"https://api.github.com/users/ZhaoGuangYue/events{/privacy}","received_events_url":"https://api.github.com/users/ZhaoGuangYue/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-11T01:43:11Z","updated_at":"2016-08-11T06:44:03Z","closed_at":null,"body":"When application sub a module only with argument parameters ,it failed at first time of the application start up ,when the application start again it success.\r\n\r\n**the reason of this issue may be:**\r\nwhen we use sysrepoctl to install a module only with argument parameters, it does not generate \".startup\" file. And when application sub this module, we will create the module socket ,before we create it we will  check if the module's subscriptions socket dir can be access( subscriptions dir path like: \"/tmp/sysrepo-subscriptions/ModuleManagedElement/\").  if it can't, we will make the dir and  set the dir permission by module's data \".startup\" file permission, as the \"startup\" file does not exist, we failed to get the data file permission, so we create the module socket failed, and the sub failed.\r\n\r\n**some questions**\r\n1. the data \".startup\" file of the module only with argument parameters should be create when install?\r\n2. as the application does not know the reason of the module can not be sub  is cause by argument or other problem, so if we should offer a way for app to judge?\r\n3. i think if we use \"sr_set_socket_dir_permissions\" failed , we should remove the dir.in the function \"cl_sm_get_server_socket_filename\" \r\n`    if (-1 == access(path, F_OK)) {\r\n        old_umask = umask(0);\r\n        ret = mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO);\r\n        umask(old_umask);\r\n        CHECK_ZERO_LOG_RETURN(ret, SR_ERR_INTERNAL, \"Unable to create the directory '%s': %s\", path, sr_strerror_safe(errno));\r\n        rc = sr_set_socket_dir_permissions(path, module_name, false);\r\n        CHECK_RC_LOG_RETURN(rc, \"Unable to set socket directory permissions for '%s'.\", path);\r\n    }`\r\n\r\n\r\nexample module of this issue\r\n```\r\nmodule Root {\r\n  namespace \"urn:ietf:params:xml:ns:yang:zte:Root\";\r\n  prefix Root;\r\n\r\n  container Root {\r\n    presence \"real Me\";\r\n    leaf RootId {\r\n      type int32;\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n```\r\nmodule ArgumentModule {\r\n  namespace \"urn:ietf:params:xml:ns:yang:fox:ArgumentModule\";\r\n  prefix ArgumentModule;\r\n  import Root{\r\n    prefix Root;\r\n  }\r\n  \r\n  augment \"/Root:Root\"{\r\n    container ArgumentModule {\r\n\t  presence \"ArgumentModule\";\r\n      leaf Id {\r\n        type int32;\r\n      }\r\n    }\r\n  } \r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/sysrepo/sysrepo/issues/comments/239084836","html_url":"https://github.com/sysrepo/sysrepo/issues/281#issuecomment-239084836","issue_url":"https://api.github.com/repos/sysrepo/sysrepo/issues/281","id":239084836,"user":{"login":"lukasmacko","id":16013493,"avatar_url":"https://avatars.githubusercontent.com/u/16013493?v=3","gravatar_id":"","url":"https://api.github.com/users/lukasmacko","html_url":"https://github.com/lukasmacko","followers_url":"https://api.github.com/users/lukasmacko/followers","following_url":"https://api.github.com/users/lukasmacko/following{/other_user}","gists_url":"https://api.github.com/users/lukasmacko/gists{/gist_id}","starred_url":"https://api.github.com/users/lukasmacko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukasmacko/subscriptions","organizations_url":"https://api.github.com/users/lukasmacko/orgs","repos_url":"https://api.github.com/users/lukasmacko/repos","events_url":"https://api.github.com/users/lukasmacko/events{/privacy}","received_events_url":"https://api.github.com/users/lukasmacko/received_events","type":"User","site_admin":false},"created_at":"2016-08-11T06:44:03Z","updated_at":"2016-08-11T06:44:03Z","body":"Hi,\r\n\r\n- .startup file is created only for models that contain a data (container, list, leaf-list, leaf nodes). If a model contains only augments or typedef statement .startup is not created. Since data of augment is stored in target module  .startup file is not needed for module containing only augments.\r\n\r\n- in this particular example ArgumentModule data is stored in Root.startup\r\n\r\n- if you want to subscribe for notification in ArgumentModule you should use xpath like this:\r\n`/Root:Root/ArgumentModule:ArgumentModule`\r\n\r\nRegards,\r\nLukas"}}
{"actor":{"display_login":"lukasmacko"}}