ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
* [sisyphus] mkimage-profiles или hasher -- кто-то не работает
@ 2014-08-12  0:13 Денис Смирнов
  2014-08-12  9:46 ` Michael Shigorin
  0 siblings, 1 reply; 7+ messages in thread
From: Денис Смирнов @ 2014-08-12  0:13 UTC (permalink / raw)
  To: sisyphus

[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]

Давно не собирал ничего из mkimage-profiles, а сейчас вижу при попытке
собрать что-либо:

mki-image-scripts: Run:
`/tmp/.private/smirnovdv/mkimage-profiles.build.GYTplFk/image-scripts.d/01-rootdir'
mki-run: has started executing.
hsh-run: changed working directory to
`/tmp/.private/smirnovdv/mkimage-profiles.build.GYTplFk/.work/chroot/.work'
hsh-run: Locked working directory
`/tmp/.private/smirnovdv/mkimage-profiles.build.GYTplFk/.work/chroot/.work'
hsh-run: Acquiring lock for config file
`/etc/hasher-priv/user.d/smirnovdv'...
hsh-run: Locked config file `/etc/hasher-priv/user.d/smirnovdv'
/.host/entry: line 10: /.host/start.sh: Permission denied
mki-image-scripts:
/tmp/.private/smirnovdv/mkimage-profiles.build.GYTplFk/image-scripts.d/01-rootdir:
unable to run script.
mki-invalidate-cache: has started executing for 'mki'.
make[2]: *** [run-image-scripts] Error 1
Command exited with non-zero status 2
1:17.08 53%CPU 111000k

Как диагностировать причину ошибки?

# $ uname -r
3.15.5-un-def-alt2
$ sudo cat /proc/sys/fs/protected_hardlinks 
0

-- 
С уважением, Денис

http://mithraen.ru/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sisyphus] mkimage-profiles или hasher -- кто-то не работает
  2014-08-12  0:13 [sisyphus] mkimage-profiles или hasher -- кто-то не работает Денис Смирнов
@ 2014-08-12  9:46 ` Michael Shigorin
  2014-08-12 14:02   ` Денис Смирнов
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Shigorin @ 2014-08-12  9:46 UTC (permalink / raw)
  To: sisyphus

On Tue, Aug 12, 2014 at 04:13:01AM +0400, Денис Смирнов wrote:
> Давно не собирал ничего из mkimage-profiles, а сейчас вижу при
> попытке собрать что-либо:

Кстати, а просто hsh там работает?

mkdir -p /tmp/.private/smirnovdv/hasher
hsh --initroot /tmp/.private/smirnovdv/hasher
hsh-run /tmp/.private/smirnovdv/hasher -- ls /

-- 
 ---- WBR, Michael Shigorin / http://altlinux.org
  ------ http://opennet.ru / http://anna-news.info


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sisyphus] mkimage-profiles или hasher -- кто-то не работает
  2014-08-12  9:46 ` Michael Shigorin
@ 2014-08-12 14:02   ` Денис Смирнов
  2014-08-12 14:12     ` Michael Shigorin
  0 siblings, 1 reply; 7+ messages in thread
From: Денис Смирнов @ 2014-08-12 14:02 UTC (permalink / raw)
  To: sisyphus

[-- Attachment #1: Type: text/plain, Size: 920 bytes --]

On Tue, Aug 12, 2014 at 01:46:27PM +0400, Michael Shigorin wrote:
> > Давно не собирал ничего из mkimage-profiles, а сейчас вижу при
> > попытке собрать что-либо:
> Кстати, а просто hsh там работает?
> mkdir -p /tmp/.private/smirnovdv/hasher
> hsh --initroot /tmp/.private/smirnovdv/hasher
> hsh-run /tmp/.private/smirnovdv/hasher -- ls /

Прекрасно работает.

А вот в том самом чруте, который остается после попытки сборки:

$ hsh-run . --rooter -- /.host/start.sh
/.host/entry: line 10: /.host/start.sh: Permission denied
$ hsh-run . --rooter -- cat /.host/start.sh
cat: /.host/start.sh: Permission denied

И, о чудо!

Я нашел в чем проблема: видимо mkimage создает тот самый script.sh
напрямую. В итоге из-за локального umask 007 к этому файлу был доступ от
юзера, но не было доступа из hasher.

Локально проблему решил umask 0 перед сборкой.

-- 
С уважением, Денис

http://mithraen.ru/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sisyphus] mkimage-profiles или hasher -- кто-то не работает
  2014-08-12 14:02   ` Денис Смирнов
@ 2014-08-12 14:12     ` Michael Shigorin
  2014-08-12 20:21       ` Денис Смирнов
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Shigorin @ 2014-08-12 14:12 UTC (permalink / raw)
  To: sisyphus

On Tue, Aug 12, 2014 at 06:02:49PM +0400, Денис Смирнов wrote:
> Я нашел в чем проблема: видимо mkimage создает тот самый
> script.sh напрямую. В итоге из-за локального umask 007 к этому
> файлу был доступ от юзера, но не было доступа из hasher.
> Локально проблему решил umask 0 перед сборкой.

Крайне странно, вижу выставление 755:
http://git.altlinux.org/gears/m/mkimage.git?p=mkimage.git;a=blob;f=tools/mki-scripts;h=f5c14ea3bf57497b8f7c8c6d60a636551f166dde;hb=HEAD#l62
http://git.altlinux.org/gears/m/mkimage.git?p=mkimage.git;a=blob;f=tools/mki-pack-custom;h=b4e21a37004041e3bf0363ca42edadcf4f772560;hb=HEAD#l32

Ещё встречается в
http://git.altlinux.org/gears/m/mkimage.git?p=mkimage.git;a=blob;f=tools/mki-copy-pkgs;h=35607946e82fa68372a776c4b90b6bbe5f1dff81;hb=HEAD#l131
но там, по идее, chmod +x в make_exec():
http://git.altlinux.org/gears/m/mkimage.git?p=mkimage.git;a=blob;f=tools/mki-sh-functions;h=50f5d2d051ca7e7beaa2b97fcaa2b7048960ab91;hb=HEAD#l65

Проверь на всякий rpm -V mkimage или обвешай эти три случая
локально отладочными echo и посмотри, где закопалось?

-- 
 ---- WBR, Michael Shigorin / http://altlinux.org
  ------ http://opennet.ru / http://anna-news.info


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sisyphus] mkimage-profiles или hasher -- кто-то не работает
  2014-08-12 14:12     ` Michael Shigorin
@ 2014-08-12 20:21       ` Денис Смирнов
  2014-08-13 10:19         ` Michael Shigorin
  0 siblings, 1 reply; 7+ messages in thread
From: Денис Смирнов @ 2014-08-12 20:21 UTC (permalink / raw)
  To: sisyphus

[-- Attachment #1: Type: text/plain, Size: 687 bytes --]

On Tue, Aug 12, 2014 at 06:12:44PM +0400, Michael Shigorin wrote:
>> Я нашел в чем проблема: видимо mkimage создает тот самый
>> script.sh напрямую. В итоге из-за локального umask 007 к этому
>> файлу был доступ от юзера, но не было доступа из hasher.
>> Локально проблему решил umask 0 перед сборкой.

chmod +x это неправильно:

Вот тебе простой скрипт для теста:

#!/bin/sh
touch test.file
umask 0
chmod 0 test.file
chmod +x test.file
ls -l test.file
umask 007
chmod 0 test.file
chmod +x test.file
ls -l test.file

chmod +x в первом и втором случае дает отличающийся результат

Глянь man chmod на предмет umask

-- 
С уважением, Денис

http://mithraen.ru/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sisyphus] mkimage-profiles или hasher -- кто-то не работает
  2014-08-12 20:21       ` Денис Смирнов
@ 2014-08-13 10:19         ` Michael Shigorin
  2014-08-13 10:29           ` Денис Смирнов
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Shigorin @ 2014-08-13 10:19 UTC (permalink / raw)
  To: sisyphus; +Cc: Alexey Gladkov

[-- Attachment #1: Type: text/plain, Size: 691 bytes --]

On Wed, Aug 13, 2014 at 12:21:07AM +0400, Денис Смирнов wrote:
> >> Я нашел в чем проблема: видимо mkimage создает тот самый
> >> script.sh напрямую. В итоге из-за локального umask 007 к этому
> >> файлу был доступ от юзера, но не было доступа из hasher.
> >> Локально проблему решил umask 0 перед сборкой.
> chmod +x это неправильно:
[...]
> Глянь man chmod на предмет umask

Ну кто ж знал, что ты с 007 :-)

Проверь, пожалуйста, у себя прилагаемый патч на
/usr/share/mkimage/tools/mki-sh-functions и если
устраивает и не будет противопоказаний -- включим
в следующую версию mkimage.

-- 
 ---- WBR, Michael Shigorin / http://altlinux.org
  ------ http://opennet.ru / http://anna-news.info

[-- Attachment #2: mki-sh-functions.diff --]
[-- Type: text/x-patch, Size: 277 bytes --]

diff --git a/tools/mki-sh-functions b/tools/mki-sh-functions
index 46fb3f2..9ca727f 100755
--- a/tools/mki-sh-functions
+++ b/tools/mki-sh-functions
@@ -64,7 +64,7 @@ get_copy_args() {
 
 make_exec() {
 	cat > "$1"
-	chmod +x -- "$1"
+	chmod 755 -- "$1"
 }
 
 run_chrooted() {

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [sisyphus] mkimage-profiles или hasher -- кто-то не работает
  2014-08-13 10:19         ` Michael Shigorin
@ 2014-08-13 10:29           ` Денис Смирнов
  0 siblings, 0 replies; 7+ messages in thread
From: Денис Смирнов @ 2014-08-13 10:29 UTC (permalink / raw)
  To: sisyphus

[-- Attachment #1: Type: text/plain, Size: 426 bytes --]

On Wed, Aug 13, 2014 at 02:19:27PM +0400, Michael Shigorin wrote:

>> Глянь man chmod на предмет umask
> Ну кто ж знал, что ты с 007 :-)

Да я сам уже об этом забыл :)

> Проверь, пожалуйста, у себя прилагаемый патч на
> /usr/share/mkimage/tools/mki-sh-functions и если
> устраивает и не будет противопоказаний -- включим
> в следующую версию mkimage.

Работает.

-- 
С уважением, Денис

http://mithraen.ru/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-08-13 10:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-12  0:13 [sisyphus] mkimage-profiles или hasher -- кто-то не работает Денис Смирнов
2014-08-12  9:46 ` Michael Shigorin
2014-08-12 14:02   ` Денис Смирнов
2014-08-12 14:12     ` Michael Shigorin
2014-08-12 20:21       ` Денис Смирнов
2014-08-13 10:19         ` Michael Shigorin
2014-08-13 10:29           ` Денис Смирнов

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git