Re: [Fuego] Jenkins service restart failure after UID:GID change
<[email protected]> Mon, 3 Jan 2022 20:11:58 +0000
| Newsgroups | dev.linux.lists.fuego |
|---|---|
| Message-ID | <BYAPR13MB25037BEE9ED1D8A768E0F40FFD499@BYAPR13MB2503.namprd13.prod.outlook.com> |
> -----Original Message----- > From: Dhinakar Kalyanasundaram <[email protected]> > > Dear Fuego users, Tim, > > Nice to get in touch & post message in this forum after quite sometime. Good to hear from you. It has been a while. :-) > > I am facing an issue related to file/folder ownership outside and inside docker. > > The ownership of 'fuego-core', 'fuego-ro' & 'fuego-rw' folders and files inside is in my name 'dhinakar' with UID:GID -> 1000:1000 on my > Linux (Ubuntu 20.04.3 LTS) host. > > Inside docker the ownership of 'fuego-core', 'fuego-ro' & 'fuego-rw' folders and files gets changed to and user whose UID:GID maps to > 1000:1000, ideally 'jenkins'. > > But unfortunately inside docker my 'jenkins' user has UID:GID -> 1001:1001 so I face permission issues when I access 'fuego-core', 'fuego- > ro' & 'fuego-rw' folders as 'jenkins' user from the Fuego Dashboard. > > I tried to fix it by changing UID:GID of 'jenkins' user inside docker to 1000:1000 using following commands, > > # usermod -u 1000 jenkins > # groupmod -g 1000 Jenkins > > and also by directly modifying /etc/passwd file (jenkins:x:1001:1001::/var/lib/jenkins:/bin/bash -> > jenkins:x:1000:1000::/var/lib/jenkins:/bin/bash) It possible to miss a few places doing this manually. I don't see /etc/group mentioned. That needs to be changed (or verified) as well. Although usermod and groupmod are supposed to change files in a user's home directory, they won't catch files outside the home directory. These need to be changed manually. I would use 'find' to make sure that the there are no stray files or directories owned by user 1001, throughout the entire file system. Try this (inside the docker container) to see what stray files with wrong ownership might exist: $ find / -xdev -user 1001 And use this to change their ownership: $ find / -xdev -user 1001 | xargs chown jenkins.jenkins If there are no stray mis-owned files, and you still get an error restarting the Jenkins service, try looking in the log at /var/log/jenkins/Jenkins.log, to see what the problem report is. > > And restarted Jenkins service after making the above changes. > > But I got the below error. > > # service jenkins restart > [FAIL] Restarting Jenkins Continuous Integration Server: jenkins failed! > > Anyone faced similar issues? If so please share your approach to solve this issue. > > > > Note: I do not want to reinstall fuego or create a new instance as I have lot of data inside current docker instance. > > Also, I do not want to change UID:GID of my ubuntu host 'dhinakar' as it is used across projects and on network. Understood. Note that some of the data may be re-creatable in a new docker container, using data from your existing fuego-rw/log directory, by using the 'deorphan-runs.py' script, but let's see if we can get the UID change implemented before trying something more complicated. Regards -- Tim > > > > Regards, > > Dhinakar > > > > > > > > > <http://ext.samsung.net/mail/ext/v1/external/status/update?userid=dhinakar.k&do=bWFpbElEPTIwMjIwMTAzMTkzOTI1ZXBjbXM1cDRkMT > dhMjViNmJlNTU3Y2VlODZmODUyZTQ5MmVlYjlmYiZyZWNpcGllbnRBZGRyZXNzPVRpbS5CaXJkQHNvbnkuY29t>