Bareos Bug Tracker
Bareos Bug Tracker

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000099bareos-core[All Projects] installer / packagespublic2013-02-26 10:152015-03-25 19:18
Reporteruser12 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSUbuntuOS Version12.10
Product Version12.4.2 
Target Version12.4.3Fixed in Version12.4.3 
Summary0000099: user bareos unable to operate tape changer due to wrong permissions
DescriptionBareos is not able to mount, label, do backup to tape because he is not allowed to: Results=cannot open SCSI device '/dev/sg3' - Permission denied
Steps To Reproduceroot@cardtech01:/etc/bareos# bconsole
Connecting to Director cardtech01:9101
1000 OK: cardtech01-dir Version: 12.4.1 (06 February 2013)
Enter a period to cancel a command.
*unmount storage=L700
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
Connecting to Storage daemon L700 at cardtech01:9103 ...
Connecting to Storage daemon L700 at cardtech01:9103 ...
3991 Bad autochanger "loaded? drive 0" command: ERR=Child exited with code 1.
Results=cannot open SCSI device '/dev/sg3' - Permission denied
*mount storage=L700
Enter autochanger slot: 1
Connecting to Storage daemon L700 at cardtech01:9103 ...
3991 Bad autochanger "loaded? drive 0" command: ERR=Child exited with code 1.
Results=cannot open SCSI device '/dev/sg3' - Permission denied

3991 Bad autochanger "loaded? drive 0" command: ERR=Child exited with code 1.
Results=cannot open SCSI device '/dev/sg3' - Permission denied

3304 Issuing autochanger "load slot 1, drive 0" command.

3992 Bad autochanger "load slot 1, drive 0": ERR=Child died from signal 15: Termination.
Results=Program killed by BAREOS (timeout)
Additional Informationroot@cardtech01:/etc/bareos# ps aux | grep bareos
root 1456 0.0 0.2 272672 2044 ? Ssl Feb25 0:09 /usr/sbin/bareos-fd -c /etc/bareos/bareos-fd.conf
bareos 29563 0.0 0.2 553740 2660 ? Ssl Feb25 0:09 /usr/sbin/bareos-sd -c /etc/bareos/bareos-sd.conf
bareos 30007 0.0 0.4 567280 4852 ? Ssl Feb25 0:12 /usr/sbin/bareos-dir -c /etc/bareos/bareos-dir.conf

ls -lh /dev/sg3
crw-rw---- 1 root tape 21, 3 Feb 25 15:04 /dev/sg3

root@cardtech01:/etc/bareos# ls -lh
insgesamt 116K
-rw-r----- 1 bareos bareos 9,2K Feb 25 19:02 bareos-dir.conf
-rw-r----- 1 root bareos 1006 Feb 25 12:36 bareos-fd.conf
-rw-r----- 1 bareos bareos 2,5K Feb 25 15:10 bareos-sd.conf
-rw-r----- 1 root bareos 194 Feb 25 12:36 bconsole.conf
-rw-r--r-- 1 root root 78K Feb 25 16:06 btape_segmentation_violation.txt
lrwxrwxrwx 1 root root 20 Feb 25 15:40 btraceback -> /usr/sbin/btraceback
-rw-r--r-- 1 root root 6,9K Feb 25 19:08 bugs.txt
-rw-r--r-- 1 root root 1,5K Feb 20 09:26 mtx-changer.conf


by the way:
root@cardtech01:/etc/bareos# grep -in kern /etc/init.d/bareos*
/etc/init.d/bareos-dir:7:# Kern E. Sibbald - 21 March 2008
/etc/init.d/bareos-fd:7:# Kern E. Sibbald - 21 March 2008
/etc/init.d/bareos-sd:7:# Kern E. Sibbald - 21 March 2008
TagsNo tags attached.
bareos-master: impact
bareos-master: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action
Attached Filespatch file icon 0001-add-daemon-user-to-required-groups.patch [^] (24,697 bytes) 2013-03-01 10:06 [Show Content]

- Relationships

-  Notes
(0000173)
mvwieringen (developer)
2013-02-26 10:24

About the last entries, Yes Kern is the Author of the original scripts
you cannot just remove that (copyright etc.)

About the actual problem what does id -a bareos show because I guess its
missing being added to the tape group as secondary group but for that we need
the output of id -a.
(0000174)
user12
2013-02-26 10:25

root@cardtech01:/etc/bareos# id -a bareos
uid=106(bareos) gid=113(bareos) Gruppen=113(bareos)
(0000179)
mvwieringen (developer)
2013-02-26 10:59

See specfile there is code there in the post action of the storage
daemon to setup the secondary groups maybe this should be moved to
bareos-config so it can be reused on debian based systems.
(0000218)
joergs (administrator)
2013-03-01 10:07

Hi Marco, what do you think about the patch, I attached to this ticket?
(0000219)
mvwieringen (developer)
2013-03-01 10:23

Why not have an extra function in bareos-config to create the user ?

And why coding on debian the user creation so many times. What I did for
the Solaris packages is create the users only once in the package with the
libraries and as any package depends on that and its in the preinstall of
that package you are sure it always exists. I understand maybe some redhat
platforms are playing games with ordering (which is a bug if you ask me) but
this is for debian which I thought didn't play games. It just looks now we
have the same code "shell scripting" many times which if it needs changing
means changing in many places.
(0000220)
joergs (administrator)
2013-03-01 10:44

Intention have been, that RPM and DEB packages are as similar as possible.
Okay, this point looses significance, after I had to change back useradd to adduser on Debian.
This is also the reason, why group and user creation is still in preinstall. On Debian it should be enough, if user creation is done in postinstall.

Options:
- remove user creation from dir, sd and fd, as the group and user bareos are already created in bareos-common. When we decide to add additional users later on (lets say for the storage daemon), we have to add the preinstall-scripts again.
- I can move user creation functions to bareos-config and call them from Debian postinstall. However, the new function must distinguish between Linux/other Unixes and Debian and other Linux. Also here, you can decide if this should be done from every package or only bareos-common.

The RPM stuff should stay as in the patch, to avoid problems.
(0000224)
mvwieringen (developer)
2013-03-01 15:55

Discussed the options and decided to leave it as its now and take the
duplication of code as an unwanted side effect.
(0000253)
user12
2013-03-08 10:15

Does this mean, that when installing bareos, the admin has to type "usermod -a -G tape bareos" to be able to operate his tape drive? In Bareos 12.4.2 it is the case - this is not going to change?
(0000254)
user12
2013-03-08 10:19

bareos user should be in group tape, when installing bareos-storagedaemon - what do you think?
(0000256)
mvwieringen (developer)
2013-03-08 10:29

This bug is still being worked on, the decision was based on the question
before the response and has to do with the wanted solution direction not
that we won't add the user to the right group but that we will leave some
code in the final solution so that its in theory possible to use different
users for fd/sd/dir etc.
(0000257)
joergs (administrator)
2013-03-08 13:58

Marco, I'm not sure what to do here. I've included the patch into this ticket and we agreed, that this is a usable way to handle it. Of course, we both also see that it is far from being perfect.

So: will you add this patch to the code? If not: what option should I implement?
(0000605)
mvwieringen adm (administrator)
2013-08-13 03:12

Fix committed to bareos bareos-12.4 branch with changesetid 973.
(0001386)
mvwieringen (developer)
2015-03-25 16:51

Fix committed to bareos2015 bareos-13.2 branch with changesetid 4294.
(0001541)
joergs (administrator)
2015-03-25 19:18

Due to the reimport of the Github repository to bugs.bareos.org, the status of some tickets have been changed. These tickets will be closed again.
Sorry for the noise.

- Related Changesets
bareos: bareos-12.4 05dde077
Timestamp: 2013-05-04 11:14:54
Author: mvwieringen adm
Ported: N/A
Details ] Diff ]
add daemon user to required groups

bareos storage daemon user must be in groups tape and/or disk
to be able to access tape devices.
Due to different behavior of different distributions
(install order if not always the same),
every package that requires a specific group/user set this up on its own.

preinstall:
bareos-common: setup default daemon group bareos and user bareos
bareos-filedaemon: setup fd group (bareos) and user (root)
bareos-storage: setup sd group (bareos) and user (bareos)
bareos-director: setup dir group (bareos) and user (bareos)

postinstall:
bareos-storage:
call bareos-config setup_sd_user, which
checks if sd group and user exists, otherwise it creates them,
and add the sd user (bareos) to the groups tape and disk, if they exists.

Tested on: Debian 6, Ubuntu 12.04 (32bit), SLES11SP2, Centos5

Fixes 0000099: user bareos unable to operate tape changer due to wrong permissions

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
mod - autoconf/configure.in Diff ] File ]
rm - debian/bareos-director.preinst Diff ] File ]
add - debian/bareos-director.preinst.in Diff ] File ]
rm - debian/bareos-filedaemon.preinst Diff ] File ]
add - debian/bareos-filedaemon.preinst.in Diff ] File ]
mod - debian/bareos-storage.postinst Diff ] File ]
rm - debian/bareos-storage.preinst Diff ] File ]
add - debian/bareos-storage.preinst.in Diff ] File ]
mod - platforms/rpms/bareos.spec Diff ] File ]
mod - scripts/bareos-config.in Diff ] File ]
bareos2015: bareos-12.4 6dcf8c33
Timestamp: 2013-05-04 13:14:54
Author: mvwieringen
Ported: N/A
Details ] Diff ]
add daemon user to required groups

bareos storage daemon user must be in groups tape and/or disk
to be able to access tape devices.
Due to different behavior of different distributions
(install order if not always the same),
every package that requires a specific group/user set this up on its own.

preinstall:
bareos-common: setup default daemon group bareos and user bareos
bareos-filedaemon: setup fd group (bareos) and user (root)
bareos-storage: setup sd group (bareos) and user (bareos)
bareos-director: setup dir group (bareos) and user (bareos)

postinstall:
bareos-storage:
call bareos-config setup_sd_user, which
checks if sd group and user exists, otherwise it creates them,
and add the sd user (bareos) to the groups tape and disk, if they exists.

Tested on: Debian 6, Ubuntu 12.04 (32bit), SLES11SP2, Centos5

Fixes 0000099: user bareos unable to operate tape changer due to wrong permissions

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
mod - autoconf/configure.in Diff ] File ]
rm - debian/bareos-director.preinst Diff ] File ]
add - debian/bareos-director.preinst.in Diff ] File ]
rm - debian/bareos-filedaemon.preinst Diff ] File ]
add - debian/bareos-filedaemon.preinst.in Diff ] File ]
mod - debian/bareos-storage.postinst Diff ] File ]
rm - debian/bareos-storage.preinst Diff ] File ]
add - debian/bareos-storage.preinst.in Diff ] File ]
mod - platforms/rpms/bareos.spec Diff ] File ]
mod - scripts/bareos-config.in Diff ] File ]
bareos: master 86b7b807
Timestamp: 2013-05-04 19:11:27
Author: mvwieringen adm
Ported: N/A
Details ] Diff ]
add daemon user to required groups

bareos storage daemon user must be in groups tape and/or disk
to be able to access tape devices.
Due to different behavior of different distributions
(install order if not always the same),
every package that requires a specific group/user set this up on its own.

preinstall:
bareos-common: setup default daemon group bareos and user bareos
bareos-filedaemon: setup fd group (bareos) and user (root)
bareos-storage: setup sd group (bareos) and user (bareos)
bareos-director: setup dir group (bareos) and user (bareos)

postinstall:
bareos-storage:
call bareos-config setup_sd_user, which
checks if sd group and user exists, otherwise it creates them,
and add the sd user (bareos) to the groups tape and disk, if they exists.

Tested on: Debian 6, Ubuntu 12.04 (32bit), SLES11SP2, Centos5

Fixes 0000099: user bareos unable to operate tape changer due to wrong permissions

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
mod - scripts/bareos-config.in Diff ] File ]
mod - platforms/rpms/bareos.spec Diff ] File ]
add - debian/bareos-storage.preinst.in Diff ] File ]
rm - debian/bareos-storage.preinst Diff ] File ]
mod - debian/bareos-storage.postinst Diff ] File ]
add - debian/bareos-filedaemon.preinst.in Diff ] File ]
rm - debian/bareos-filedaemon.preinst Diff ] File ]
add - debian/bareos-director.preinst.in Diff ] File ]
rm - debian/bareos-director.preinst Diff ] File ]
mod - autoconf/configure.in Diff ] File ]
bareos2015: bareos-13.2 9a69ea9e
Timestamp: 2013-05-04 21:11:27
Author: mvwieringen
Ported: N/A
Details ] Diff ]
add daemon user to required groups

bareos storage daemon user must be in groups tape and/or disk
to be able to access tape devices.
Due to different behavior of different distributions
(install order if not always the same),
every package that requires a specific group/user set this up on its own.

preinstall:
bareos-common: setup default daemon group bareos and user bareos
bareos-filedaemon: setup fd group (bareos) and user (root)
bareos-storage: setup sd group (bareos) and user (bareos)
bareos-director: setup dir group (bareos) and user (bareos)

postinstall:
bareos-storage:
call bareos-config setup_sd_user, which
checks if sd group and user exists, otherwise it creates them,
and add the sd user (bareos) to the groups tape and disk, if they exists.

Tested on: Debian 6, Ubuntu 12.04 (32bit), SLES11SP2, Centos5

Fixes 0000099: user bareos unable to operate tape changer due to wrong permissions

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
mod - autoconf/configure.in Diff ] File ]
rm - debian/bareos-director.preinst Diff ] File ]
add - debian/bareos-director.preinst.in Diff ] File ]
rm - debian/bareos-filedaemon.preinst Diff ] File ]
add - debian/bareos-filedaemon.preinst.in Diff ] File ]
mod - debian/bareos-storage.postinst Diff ] File ]
rm - debian/bareos-storage.preinst Diff ] File ]
add - debian/bareos-storage.preinst.in Diff ] File ]
mod - platforms/rpms/bareos.spec Diff ] File ]
mod - scripts/bareos-config.in Diff ] File ]

- Issue History
Date Modified Username Field Change
2013-02-26 10:15 user12 New Issue
2013-02-26 10:15 user12 Status new => assigned
2013-02-26 10:15 user12 Assigned To => joergs
2013-02-26 10:24 mvwieringen Note Added: 0000173
2013-02-26 10:25 user12 Note Added: 0000174
2013-02-26 10:59 mvwieringen Note Added: 0000179
2013-02-27 10:07 mvwieringen Assigned To joergs => mvwieringen
2013-02-28 10:25 mvwieringen Assigned To mvwieringen => joergs
2013-03-01 10:06 joergs File Added: 0001-add-daemon-user-to-required-groups.patch
2013-03-01 10:06 joergs Assigned To joergs => mvwieringen
2013-03-01 10:07 joergs Note Added: 0000218
2013-03-01 10:23 mvwieringen Note Added: 0000219
2013-03-01 10:23 mvwieringen Assigned To mvwieringen => joergs
2013-03-01 10:44 joergs Note Added: 0000220
2013-03-01 10:47 joergs Assigned To joergs => mvwieringen
2013-03-01 15:55 mvwieringen Note Added: 0000224
2013-03-01 15:55 mvwieringen Assigned To mvwieringen => joergs
2013-03-08 10:15 user12 Note Added: 0000253
2013-03-08 10:19 user12 Note Added: 0000254
2013-03-08 10:19 user12 Status assigned => feedback
2013-03-08 10:29 mvwieringen Note Added: 0000256
2013-03-08 13:58 joergs Note Added: 0000257
2013-03-08 13:58 joergs Assigned To joergs => mvwieringen
2013-03-08 15:59 maik Severity block => major
2013-03-08 15:59 maik Status feedback => resolved
2013-03-08 15:59 maik Product Version 12.4.1 => 12.4.2
2013-03-08 15:59 maik Target Version 12.4.1 => 12.4.3
2013-03-08 16:51 mvwieringen Changeset attached => bareos master 6727d249
2013-03-08 16:51 mvwieringen Note Added: 0000262
2013-03-08 16:51 mvwieringen Status resolved => closed
2013-03-08 16:51 mvwieringen Resolution open => fixed
2013-03-09 10:26 mvwieringen Changeset attached => bareos Branch-12.4 5d879d3a
2013-03-09 10:26 mvwieringen Note Added: 0000268
2013-03-09 10:27 mvwieringen Assigned To mvwieringen =>
2013-03-09 10:27 mvwieringen Fixed in Version => 12.4.3
2013-08-13 03:12 mvwieringen adm Changeset attached => bareos master 86b7b807
2013-08-13 03:12 mvwieringen adm Changeset attached => bareos bareos-12.4 05dde077
2013-08-13 03:12 mvwieringen adm Note Added: 0000605
2013-08-13 03:12 mvwieringen adm Assigned To => mvwieringen adm
2013-08-13 03:12 mvwieringen adm Status closed => resolved
2013-08-13 09:16 mvwieringen adm Note Deleted: 0000262
2013-08-13 09:16 mvwieringen adm Note Deleted: 0000268
2013-08-13 09:16 mvwieringen adm Assigned To mvwieringen adm =>
2013-08-13 09:16 mvwieringen adm Status resolved => closed
2015-03-25 16:51 mvwieringen Changeset attached => bareos2015 bareos-12.4 6dcf8c33
2015-03-25 16:51 mvwieringen Changeset attached => bareos2015 bareos-13.2 9a69ea9e
2015-03-25 16:51 mvwieringen Note Added: 0001386
2015-03-25 16:51 mvwieringen Status closed => resolved
2015-03-25 19:18 joergs Note Added: 0001541
2015-03-25 19:18 joergs Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker