ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: Lex Shen <lex.shen@yandex.ru>
To: sisyphus@lists.altlinux.org
Subject: Re: [sisyphus] zoneminder 1.30.4
Date: Fri, 27 Oct 2017 21:46:26 +0300
Message-ID: <e2a0e097-a356-aefa-5804-8d94aee993c3@yandex.ru> (raw)
In-Reply-To: <a41bd6d9-e75a-0dc3-909d-718db62c9467@yandex.ru>

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

27.10.2017 13:56, Шенцев Алексей пишет:
> 27.10.2017 12:19, Шенцев Алексей пишет:
>> 26.10.2017 15:29, Шенцев Алексей пишет:
>>>>>> Логах нет ругани про права доступа и всё такое, но консоль всё 
>>>>>> равно пишет что остановлена.
>>>>>>
>>
>> Всё оказалось проще, права доступа к сокету должны быть такими:
>>
>>
>> ls -l /var/lib/zoneminder/sock
>> итого 0
>> srwxrwxr-x 1 apache _webserver 0 окт 27 11:04 zmdc.sock
>>
>> Вопрос:
>>
>> куда прописать установку нужных прав, дабы сокет создавался как надо? 
>
> Имеем:
>
> cat /etc/init.d/zoneminder|grep -i sock
>     #Make sure the folder for the socks file exists or create one
>     GetPath="select Value from Config where Name='ZM_PATH_SOCKS'"
>         ZM_PATH_SOCK=`echo $GetPath | mysql -B -h$ZM_DB_HOST 
> -u$ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'`
>         ZM_PATH_SOCK=`echo $GetPath | mysql -B -h$dbHost -P$dbPort 
> -u$ZM_DB_USER -p$ZM_DB_PASS $ZM_DB_NAME | grep -v '^Value'`
>     [ ! -d $ZM_PATH_SOCK ] \
>         && mkdir -m 774 $ZM_PATH_SOCK \
>         && chown $ZM_WEB_USER:$ZM_WEB_GROUP $ZM_PATH_SOCK
>
> Права и владелец в скрипте выставляются правильно, но в 
> действительности имеем такое:
>
> systemctl restart zoneminder && ls -l /var/lib/zoneminder/sock
> итого 0
> srwxr-xr-x 1 apache apache 0 окт 27 13:53 zmdc.sock
>
> т.е. 744 apache:apache
>
> Наш баг?
>
> Такое поведение наблюдаю как на p8, так и на сизифе.
>
> Что делать?
> Править ручками каждый раз пре рестарте zoneminder'а / системы?

Это не наш баг,  да и не баг, это особенность сборки/поведения zoneminder:

set(ZM_WEB_GROUP "" CACHE STRING
     "The group apache or the local web server runs on,
     Leave empty to be the same as the web user")

# Check if webgroup contains anything. If not, use the web user as the 
web group
if(NOT ZM_WEB_GROUP)
         set(ZM_WEB_GROUP ${ZM_WEB_USER})
endif(NOT ZM_WEB_GROUP)

В общем если в CMakeLists.txt параметр ZM_WEB_GROUP пуст, то по 
умолчанию ставится группа apache.
Так что придётся пересобирать с set(ZM_WEB_GROUP "_webserver" CACHE STRING .
Т.е. если zoneminder собран без явного задания вэб-группы, то по 
умолчанию ставиться группа apach и можно извращаться с правами доступа ( 
чем я и занимался отлавливая блох на рабочем серваке :) а собака то 
зарыта в другом месте) и т.д. и т.п. всё равно zm будет создавать свои 
файлы с правами apache:apache


Патч во вложении.

На днях пересоберу и посмотрю в работы - прав я или нет.

P.S.: я понимаю, Антон использует zm с nginx, а там apache:apache, по 
сему и не нарвался на такое.
Это я извращенец, делаю на фзфсру2 & systemd.




[-- Attachment #2: CMakeLists.txt.alt.path --]
[-- Type: text/x-systemd-unit, Size: 520 bytes --]

--- CMakeLists.txt.orign	2017-10-21 17:29:37.527236238 +0300
+++ CMakeLists.txt	2017-10-27 21:26:25.087770591 +0300
@@ -112,7 +112,7 @@
 set(ZM_WEB_USER "" CACHE STRING 
     "The user apache or the local web server runs on. Leave empty for automatic detection. 
      If that fails, you can use this variable to force")
-set(ZM_WEB_GROUP "" CACHE STRING 
+set(ZM_WEB_GROUP "_webserver" CACHE STRING 
     "The group apache or the local web server runs on, 
     Leave empty to be the same as the web user")
 # Advanced

      reply	other threads:[~2017-10-27 18:46 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26  7:38 [sisyphus] zoneminder 1.30 & p8 Алексей Шенцев
2017-10-26  7:47 ` Alexey Shabalin
2017-10-26  8:01   ` Алексей Шенцев
2017-10-26  8:07     ` Alexey Shabalin
2017-10-26  8:28       ` Алексей Шенцев
2017-10-26  8:17     ` Anton Farygin
2017-10-26  8:27       ` Алексей Шенцев
2017-10-26  9:02           ` Алексей Шенцев
2017-10-26  9:05             ` Anton Farygin
2017-10-26  9:07               ` Anton Farygin
2017-10-26  9:28                 ` Алексей Шенцев
2017-10-26  9:30                   ` Anton Farygin
2017-10-26  9:36                     ` Алексей Шенцев
2017-10-26 10:21                       ` Anton Farygin
2017-10-26 10:45                         ` Алексей Шенцев
2017-10-26 10:46                           ` Anton Farygin
2017-10-26 11:28                           ` Шенцев Алексей
2017-10-26 11:44                             ` Anton Farygin
2017-10-26 11:46                             ` Шенцев Алексей
2017-10-26 12:20                               ` Шенцев Алексей
2017-10-26  9:11             ` Alexei Takaseev
2017-10-26  9:23               ` Алексей Шенцев
2017-10-26  9:29                 ` Anton Farygin
2017-10-26  9:38                   ` Алексей Шенцев
2017-10-26  9:56                   ` Алексей Шенцев
2017-10-26 10:22                     ` Anton Farygin
2017-10-26 12:29 ` Шенцев Алексей
2017-10-26 12:32   ` Anton Farygin
2017-10-26 12:50     ` Шенцев Алексей
2017-10-26 13:06       ` Anton Farygin
2017-10-27  9:19         ` Шенцев Алексей
2017-10-27 10:56           ` [sisyphus] zoneminder 1.30.4 Шенцев Алексей
2017-10-27 18:46             ` Lex Shen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e2a0e097-a356-aefa-5804-8d94aee993c3@yandex.ru \
    --to=lex.shen@yandex.ru \
    --cc=sisyphus@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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