[systemd-devel] [Install] question

2013-08-01 Thread lux-integ
Greetings,

I am trying to learn to use systemd.

I  scanned through some of the online manpages and looked at some example unit 
files.  I keep seeing

[Install]
WantedBy=multi-user.target

or

[Install]
WantedBy=sysinit.target 

or some such

I have for example a need to mount stuff (via a mount unit )  then to create 
directories and copy stuff to them
I dont know if these '/bin/mkdir'  and '/bin/cp'  tasks  can be done under 
'[Install]'

Ib brief, I dont know what [Install] is for, 
--what goes under it?
--when it is used ?
--or not used etc ?
--and I cant locate a manpage to explain it.  

I would be grateful if someone could send me the appropriate URL for 'Install' 
manpage  and or explain what it is and how it is used.


thanks in advance

luxInteg
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [Install] question

2013-08-01 Thread Tomasz Torcz
On Thu, Aug 01, 2013 at 07:48:19AM +0100, lux-integ wrote:
 Greetings,
 
 I am trying to learn to use systemd.
 
 I  scanned through some of the online manpages and looked at some example 
 unit 
 files.  I keep seeing
 
 [Install]
 WantedBy=multi-user.target
 
 or
 
 [Install]
 WantedBy=sysinit.target 
 
 or some such
 
  Description of targets is in man systemd.special.


 I have for example a need to mount stuff (via a mount unit )  then to create 
 directories and copy stuff to them
 I dont know if these '/bin/mkdir'  and '/bin/cp'  tasks  can be done under 
 '[Install]'
 
  They cannot be in mount.  There are few way to accomplish what you want,
but without details I can provide only vague directions.  You need to create
unit for your work.  You can stuff mkdir into ExecStartPre and cp into 
ExecStart;
you have to make your unit Require the mount unit (or go with the automounter);
activation of your work unit should trigger mount.
  There are few details to work out, like for example usage of PartOf.

 
 Ib brief, I dont know what [Install] is for, 
 --what goes under it?
 --when it is used ?
 --or not used etc ?
 --and I cant locate a manpage to explain it.  
 
 I would be grateful if someone could send me the appropriate URL for 
 'Install' 
 manpage  and or explain what it is and how it is used.

  Start with man systemd.unit and search for [Install]. All four directives
are described there.
  The information is used by systemctl enable command to create appropriate 
symlinks.

  Man pages are also available at 
http://www.freedesktop.org/software/systemd/man/
-- 
Tomasz Torcz   ,,(...) today's high-end is tomorrow's embedded processor.''
xmpp: zdzich...@chrome.pl  -- Mitchell Blank on LKML

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] fstab-generator: introduce rd.weak_sysroot to bypass failures in sysroot.mount

2013-08-01 Thread Colin Guthrie
'Twas brillig, and WANG Chao at 01/08/13 06:36 did gyre and gimble:
 On 07/30/13 at 04:40pm, Tom Gundersen wrote:
 On Tue, Jul 30, 2013 at 4:13 PM, Harald Hoyer har...@redhat.com wrote:
 On 07/30/2013 03:46 PM, Zbigniew Jędrzejewski-Szmek wrote:
 Maybe rootfsflags=nofail could do be used as this flag?

 rootfsflags=nofail sounds ok, if it is not used for booting the initial 
 system.

 Yeah, you are right, this looks like it should just work.

 Though the behavior of initrd-parse-etc.service and
 initrd-switch-root.service will be non-deterministic if this flag is
 specified (unless I'm missing something). Maybe they should be
 explicitly ordered After/Wants=sysroot.mount ? That may cause a long
 timeout, but at least there will be no emergency mode.
 
 No, guys, nofail mount option will *only* work when device (or should I
 say filesystem) doesn't exist.
 
 From mount(8):
 [..]
_nofail_ Do not report errors for this device if it does not exist.

I'm not sure that description is 100% true under systemd. Looking at the
code, it seems to control the dependencies of the mount units (namely
changing a Requires= to the softer Wants=)

 So if filesystem is corrupted or something else fails the sysroot.mount,
 initrd-root-fs.target will never be reached.

Is this actually true? Given the above comment? But that said, it could
easily be that the / mountpoint is handled specially in systemd (I've
not looked at the code that closely) which may explain why nofail
doesn't work for it like it would for other mounts...

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] fstab-generator: introduce rd.weak_sysroot to bypass failures in sysroot.mount

2013-08-01 Thread Colin Guthrie
[Resend because I fail at reply-all]

'Twas brillig, and WANG Chao at 01/08/13 06:36 did gyre and gimble:
 On 07/30/13 at 04:40pm, Tom Gundersen wrote:
 On Tue, Jul 30, 2013 at 4:13 PM, Harald Hoyer har...@redhat.com wrote:
 On 07/30/2013 03:46 PM, Zbigniew Jędrzejewski-Szmek wrote:
 Maybe rootfsflags=nofail could do be used as this flag?

 rootfsflags=nofail sounds ok, if it is not used for booting the initial 
 system.

 Yeah, you are right, this looks like it should just work.

 Though the behavior of initrd-parse-etc.service and
 initrd-switch-root.service will be non-deterministic if this flag is
 specified (unless I'm missing something). Maybe they should be
 explicitly ordered After/Wants=sysroot.mount ? That may cause a long
 timeout, but at least there will be no emergency mode.
 
 No, guys, nofail mount option will *only* work when device (or should I
 say filesystem) doesn't exist.
 
 From mount(8):
 [..]
_nofail_ Do not report errors for this device if it does not exist.

I'm not sure that description is 100% true under systemd. Looking at the
code, it seems to control the dependencies of the mount units (namely
changing a Requires= to the softer Wants=)

It may be worth trying to push an updated description into the mount man
page to mention systemd's behaviour here?

 So if filesystem is corrupted or something else fails the sysroot.mount,
 initrd-root-fs.target will never be reached.

Is this actually true? Given the above comment? It could easily be that
the / mountpoint is handled more specially in systemd tho' (I've not
looked at the code that closely).

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] macros in systemd unit files question

2013-08-01 Thread Michal Vyskocil
On Wed, Jul 31, 2013 at 06:59:18PM +0100, lux-integ wrote:
 On Wednesday 31 July 2013 14:22:35 Michal Vyskocil wrote:
  You can split the logic into two mount units with opposite Condition
  
  #mountpoint.mount
  [Unit]
  Description=mount mountpoint
  ConditionPathIsMountPoint=/mountpoint
  
  [Mount]
  What=/dev/something
  Where=/mountpoint
  
  #somewherelse.mount
  [Unit]
  Description=mount somewhereelse
  ConditionPathIsMountPoint=!/mountpoint
  
  [Mount]
  What=/dev/something
  Where=/somewhereelse
 
 
 very elegant
 
 many thanks for this
 
 
 now suppose my original file had more than mount in it  say it was
 
  #--
  IF mountpoint exists
  /bin/mount /dev/something  $mountpoint
 /bin/mkdir $mountpoint/somedir
 /bin/cp something   $mountpoint/somedir
  ELSE
  /bin/mount /dev/something somewherelse
 /bin/mkdir  somewherelse/someotherdir
 /bin/cp somethingelse   somewherelse/someotherdir/
  ENDiF
  #--
 
 How would I do this ? 
 in otherWORDS:-
 a) can I add other non-mount commands to mount units?

No, mount units are just more flexible replacenment of /etc/fstab.
Please consult the man systemd.mount.

 OR
 b) can I call mount units in other   types  of units  in say service units  
 (i.e. with  'ExecStart= ) and if so how so ?

Systemd units are not scripts, so can't be called. You can divide your
functionality into independent units, but that'd be overkill. If you
need more complex functionality, then simply call your script from one
.service file and let script do his work.

Regards
Michal Vyskocil


signature.asc
Description: Digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] fstab-generator: introduce rd.weak_sysroot to bypass failures in sysroot.mount

2013-08-01 Thread WANG Chao
On 08/01/13 at 08:49am, Colin Guthrie wrote:
 [Resend because I fail at reply-all]
 
 'Twas brillig, and WANG Chao at 01/08/13 06:36 did gyre and gimble:
  On 07/30/13 at 04:40pm, Tom Gundersen wrote:
  On Tue, Jul 30, 2013 at 4:13 PM, Harald Hoyer har...@redhat.com wrote:
  On 07/30/2013 03:46 PM, Zbigniew Jędrzejewski-Szmek wrote:
  Maybe rootfsflags=nofail could do be used as this flag?
 
  rootfsflags=nofail sounds ok, if it is not used for booting the initial 
  system.
 
  Yeah, you are right, this looks like it should just work.
 
  Though the behavior of initrd-parse-etc.service and
  initrd-switch-root.service will be non-deterministic if this flag is
  specified (unless I'm missing something). Maybe they should be
  explicitly ordered After/Wants=sysroot.mount ? That may cause a long
  timeout, but at least there will be no emergency mode.
  
  No, guys, nofail mount option will *only* work when device (or should I
  say filesystem) doesn't exist.
  
  From mount(8):
  [..]
 _nofail_ Do not report errors for this device if it does not exist.
 
 I'm not sure that description is 100% true under systemd. Looking at the
 code, it seems to control the dependencies of the mount units (namely
 changing a Requires= to the softer Wants=)

rootflags=nofail only results in mount -o nofail /dev/root /sysroot

OTOH, bool variable nofail from add_mount(.., bool nofail, ..) is used
to changing Requires= to Wants.

 
 It may be worth trying to push an updated description into the mount man
 page to mention systemd's behaviour here?

Nothing to do with systemd. systemd will just pass nofail and other
mount options to mount.

 
  So if filesystem is corrupted or something else fails the sysroot.mount,
  initrd-root-fs.target will never be reached.
 
 Is this actually true? Given the above comment? It could easily be that
 the / mountpoint is handled more specially in systemd tho' (I've not
 looked at the code that closely).

Yes, that's true. sysroot.mount is automatically generated and
mandatory be required by initrd-root-fs.target.

Thanks
WANG Chao
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [Install] question

2013-08-01 Thread lux-integ
On Thursday 01 August 2013 08:00:49 Tomasz Torcz wrote:
   They cannot be in mount.  There are few way to accomplish what you want,
 but without details I can provide only vague directions.  You need to
 create unit for your work.  You can stuff mkdir into ExecStartPre and cp
 into ExecStart; you have to make your unit Require the mount unit (or go
 with the automounter); activation of your work unit should trigger mount.
   There are few details to work out, like for example usage of PartOf.


Thanks for your reply

I take the opportunity  to  layout in more detail what my problem is and 
hopefully you and others will provide guidance:-


I want to translate the followingfrom a typical init scipt to systemd.

##
/bin/mount \
-m $someMode \
-t someType \
-o opt1,opt2,opt3 \
someDIR  /somewhereInFS

/bin/mkdir  \
--mode $someMode  $someDIR/otherDIR

/bin/cp -a someStuff  $someDIR/otherDIR

#

My first approach is to   use a so-called service file like so


[Unit]
Description=Mounting and copying stuff

[Service]
ExecStart=/bin/mount \
-m $someMode \
-t someType \
-o opt1,opt2,opt3 \
someDIR  /somewhereInFS

ExecStart=/bin/mkdir  \
--mode $someMode  $someDIR/otherDIR

ExecStart=/bin/cp -a someStuff  $someDIR/otherDIR

##
However I would like to use so called mount units and   with this approach 
this is the furtherst I get:-

[Unit]
Description=Mounting somewhereInFS
#After=dont know what to put here?
#Before=dont know what to put here?



[Mount]
What=someDIR 
Where=/somewhereInFS
Type=someType
Options=opt1,opt2,opt3
DirectoryMode=$someMode

I am then stuck I dont know where to put the last two commands namely:-

#
ExecStart=/bin/mkdir  \
--mode $someMode  $someDIR/otherDIR
and
ExecStart=/bin/cp -a someStuff  $someDIR/otherDIR
#--


do I have to create a service file for these and if so  how do I ensurethe 
mount unit is exicuted before  this service is called?
( Remark::- this is a learnig exercise  And  using  fstab is not in such an 
instance an option )

Thanks in advance

sincerely
luxInteg
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] journal: handle multiline syslog messages

2013-08-01 Thread harald
From: Harald Hoyer har...@redhat.com

Since the journal can handle multiple lines just well natively,
and rsyslog can be configured to handle them as well, there is no need
to truncate messages from syslog() after the first newline.

Reproducer:

1. Add following four lines to /etc/rsyslog.conf

   --
   $EscapeControlCharactersOnReceive off
   $ActionFileDefaultTemplate RSYSLOG_SysklogdFileFormat
   $SpaceLFOnReceive on
   $DropTrailingLFOnReception off
   --

3. Restart rsyslog
  # service rsyslog restart

4. Compile and run the following program

   --
   #include stdio.h
   #include syslog.h

   int main()
   {
syslog(LOG_INFO, aaa%caaa, '\n');
return 0;
   }
   --

Actual results:
Below message appears in /var/log/messages.

   --
   Sep  7 19:19:39 localhost test2: aaa
   --

Expected results:
Below message, which worked prior to systemd-journald
appears in /var/log/messages.

   --
   Sep  7 19:19:39 localhost test2: aaa aaa

https://bugzilla.redhat.com/show_bug.cgi?id=855313
---
 src/journal/journald-server.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 821935c..f417059 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -1240,12 +1240,7 @@ int process_event(Server *s, struct epoll_event *ev) {
 char *e;
 
 if (n  0  n_fds == 0) {
-e = memchr(s-buffer, '\n', n);
-if (e)
-*e = 0;
-else
-s-buffer[n] = 0;
-
+s-buffer[n] = 0;
 server_process_syslog_message(s, 
strstrip(s-buffer), ucred, tv, label, label_len);
 } else if (n_fds  0)
 log_warning(Got file descriptors via 
syslog socket. Ignoring.);
-- 
1.8.3.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] macros in systemd unit files question

2013-08-01 Thread lux-integ
On Wednesday 31 July 2013 14:36:25 Colin Guthrie wrote:
 Mount units have to be named specially after their mount points, so be
 careful there e.g. if the mount point is /mnt/mymountpoint then the unit
 should be called mnt-mymountpoint.mount

thanks for your reply

Now I have an init script to  translate to systemd with this:-
/bin/echo  Remounting root file system in read-write mode...
/bin/mount -n -o remount,rw / /dev/null


which I translate to systemd-speak ( mount file ) as 
#
[Unit]
Description=Remounting root file system in read-write mode...
#After=dev.mount
#Before=


[Mount]
What=/
Where=/
Options=remount,rw
#-

what do I call this file?
rootfs.mount ?
(and if so would it not contradict with the What and Where in [Mount] ?

or
/.mount 
(which I doubt would be allowed)

advice will be apreciated

sincerely
luxInteg 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [Install] question

2013-08-01 Thread lux-integ
On Thursday 01 August 2013 08:00:49 Tomasz Torcz wrote:
 You can stuff mkdir into ExecStartPre and cp into ExecStart;
 you have to make your unit Require the mount unit (or go with the
 automounter); activation of your work unit should trigger mount.


many thanks for this
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] macros in systemd unit files question

2013-08-01 Thread Colin Guthrie
'Twas brillig, and lux-integ at 01/08/13 11:53 did gyre and gimble:
 On Wednesday 31 July 2013 14:36:25 Colin Guthrie wrote:
 Mount units have to be named specially after their mount points, so be
 careful there e.g. if the mount point is /mnt/mymountpoint then the unit
 should be called mnt-mymountpoint.mount
 
 thanks for your reply
 
 Now I have an init script to  translate to systemd with this:-
 /bin/echo  Remounting root file system in read-write mode...
 /bin/mount -n -o remount,rw / /dev/null
 
 
 which I translate to systemd-speak ( mount file ) as 
 #
 [Unit]
 Description=Remounting root file system in read-write mode...
 #After=dev.mount
 #Before=
 
 
 [Mount]
 What=/
 Where=/
 Options=remount,rw
 #-

You generally wouldn't set the description in such a mount unit Remount
root file Just use Description=Root Filesystem or similar. The
mount options themselves are an implementation detail.

 what do I call this file?
 rootfs.mount ?
 (and if so would it not contradict with the What and Where in [Mount] ?

The rootfs mount is called -.mount (i.e. a leading -)

To be honest with you tho', unless you are tailoring your system for a
very specific case and disabling support for /etc/fstab completely, I'd
just specify your mount options in /etc/fstab as before and systemd will
just interpret it and generate your mount units for you. You don't need
to do anything special to get your mount options applied as systemd will
do that for you.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] macros in systemd unit files question

2013-08-01 Thread lux-integ
On Thursday 01 August 2013 12:15:21 Colin Guthrie wrote:
 The rootfs mount is called -.mount (i.e. a leading -)
many thanks for this
 To be honest with you tho', unless you are tailoring your system for a
 very specific case

yes this is so, 
it is  remounting  /  (RW) earlier in the boot process
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] macros in systemd unit files question

2013-08-01 Thread Tom Gundersen
On Thu, Aug 1, 2013 at 1:45 PM, lux-integ lux-in...@btconnect.com wrote:
 On Thursday 01 August 2013 12:15:21 Colin Guthrie wrote:
 The rootfs mount is called -.mount (i.e. a leading -)
 many thanks for this
 To be honest with you tho', unless you are tailoring your system for a
 very specific case

 yes this is so,
 it is  remounting  /  (RW) earlier in the boot process

I'm not following. Do you mean that systemd is already doing what you
need, or do you need something different from what systemd does. For
the record the standard behavior is: Your / will be first mounted
according to the options on the kernel commandline (ro or rw), then
systemd-remount-fs.service will remount it based on the options in
/etc/fstab (which could be rw). Do you need anything different than
this?

-t
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] macros in systemd unit files question

2013-08-01 Thread lux-integ
On Thursday 01 August 2013 12:58:46 Tom Gundersen wrote:
 'm not following. Do you mean that systemd is already doing what you
 need,


not sure  as I am just learning 


...but suppose 
I have already mounted   proc, run and sys  
and I want just a read only root filesystem 

--a)  how do  I get  systemd to mount a   nonRW  root filesystemand not 
bother with anything  in fstab.?  OR
--b) could I  have  an fstab  with  /  -o,ro?
( and if so what would systemd-remount-fs.service do ?)


thanks in advance
sincerely
luxInteg

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] macros in systemd unit files question

2013-08-01 Thread Colin Guthrie
'Twas brillig, and lux-integ at 01/08/13 15:25 did gyre and gimble:
 On Thursday 01 August 2013 12:58:46 Tom Gundersen wrote:
 'm not following. Do you mean that systemd is already doing what you
 need,
 
 
 not sure  as I am just learning 
 
 
 ...but suppose 
 I have already mounted   proc, run and sys  
 and I want just a read only root filesystem 
 
 --a)  how do  I get  systemd to mount a   nonRW  root filesystemand not 
 bother with anything  in fstab.?  OR
 --b) could I  have  an fstab  with  /  -o,ro?
 ( and if so what would systemd-remount-fs.service do ?)

Exactly the same as with sysvinit - just set the options in fstab.

Or if you don't want an fstab then set the options in the -.mount unit
instead.

The systemd-remount-fs.service will then basically be a no-op if the
options don't change.

Col



-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] macros in systemd unit files question

2013-08-01 Thread Tom Gundersen
On Thu, Aug 1, 2013 at 4:25 PM, lux-integ lux-in...@btconnect.com wrote:
 On Thursday 01 August 2013 12:58:46 Tom Gundersen wrote:
 'm not following. Do you mean that systemd is already doing what you
 need,


 not sure  as I am just learning


 ...but suppose
 I have already mounted   proc, run and sys
 and I want just a read only root filesystem

 --a)  how do  I get  systemd to mount a   nonRW  root filesystemand not
 bother with anything  in fstab.?  OR
 --b) could I  have  an fstab  with  /  -o,ro?
 ( and if so what would systemd-remount-fs.service do ?)

If all you want is an RO rootfs, just specify ro on the kernel
commandline and drop the rootfs entry from fstab, or if you still want
the rootfs entry in fstab make sure it also has ro as an option.
FWIW, systemd should be mounting /proc, /run and /sys for you (don't
know if that is relevant).

-t
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] macros in systemd unit files question

2013-08-01 Thread Daniel Wallace
On Thu, Aug 1, 2013 at 9:41 AM, Colin Guthrie gm...@colin.guthr.ie wrote:

 'Twas brillig, and lux-integ at 01/08/13 15:25 did gyre and gimble:
  On Thursday 01 August 2013 12:58:46 Tom Gundersen wrote:
  'm not following. Do you mean that systemd is already doing what you
  need,
 
 
  not sure  as I am just learning
 
 
  ...but suppose
  I have already mounted   proc, run and sys
  and I want just a read only root filesystem
 
  --a)  how do  I get  systemd to mount a   nonRW  root filesystemand
 not
  bother with anything  in fstab.?  OR
  --b) could I  have  an fstab  with  /  -o,ro?
  ( and if so what would systemd-remount-fs.service do ?)

 Exactly the same as with sysvinit - just set the options in fstab.

 Or if you don't want an fstab then set the options in the -.mount unit
 instead.

 The systemd-remount-fs.service will then basically be a no-op if the
 options don't change.



Couldn't you just systemctl mask systemd-remount-fs.service
and just keep ro in the kernel line of your bootloader?

Then you just wouldn't remount the filesystem as rw, which
would be what is listed in your fstab.



 Col



 --

 Colin Guthrie
 gmane(at)colin.guthr.ie
 http://colin.guthr.ie/

 Day Job:
   Tribalogic Limited http://www.tribalogic.net/
 Open Source:
   Mageia Contributor http://www.mageia.org/
   PulseAudio Hacker http://www.pulseaudio.org/
   Trac Hacker http://trac.edgewall.org/
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [Feature request] A way to native import /proc/cmdline within unit

2013-08-01 Thread Jan Engelhardt

On Tuesday 2013-07-30 02:12, Gerardo Exequiel Pozzi wrote:

In inside systemd unit, I want to avoid shell script if possible, using
units only, doing things in a systemd way. Anyway for complex tasks
where systemd does not fit, scripting seems to be necessary.

The systemd way is not {avoiding shell scripts at all cost},
but avoiding redundant code found in the many sysvinit scripts.
At least, that is how I see it.

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] fixed hashmap leaks in mmap-cache

2013-08-01 Thread George McCollister
hashmap_free() wasn't being called on m-contexts and m-fds resulting
in a leak.

To reproduce do:
while(1) {
sd_journal_open(j, SD_JOURNAL_LOCAL_ONLY);
sd_journal_close(j);
}

Memory usage will increase until OOM.

Signed-off-by: George McCollister george.mccollis...@gmail.com
---
 src/journal/mmap-cache.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/journal/mmap-cache.c b/src/journal/mmap-cache.c
index 767f555..03b57be 100644
--- a/src/journal/mmap-cache.c
+++ b/src/journal/mmap-cache.c
@@ -307,9 +307,13 @@ static void mmap_cache_free(MMapCache *m) {
 while ((c = hashmap_first(m-contexts)))
 context_free(c);
 
+hashmap_free(m-contexts);
+
 while ((f = hashmap_first(m-fds)))
 fd_free(f);
 
+hashmap_free(m-fds);
+
 while (m-unused)
 window_free(m-unused);
 
-- 
1.8.2.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 18/18] shell-comp: Fix up unit completing for _journalctl

2013-08-01 Thread William Giokas
-u and --user-unit can be specified multiple times, so put a * in front
of it, and --user-unit can have an =, and should be looking for the
USER_UNIT not _SYSTEMD_USER_UNIT.
---
 shell-completion/zsh/_journalctl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/shell-completion/zsh/_journalctl b/shell-completion/zsh/_journalctl
index 61983d5..76cb594 100644
--- a/shell-completion/zsh/_journalctl
+++ b/shell-completion/zsh/_journalctl
@@ -66,8 +66,8 @@ _arguments -s \
 {-m,--merge}'[Show entries from all available journals]' \
 {-b,--boot=}'[Show data only from the specified boot or offset]:boot id or 
offset:_journal_boots' \
 {-k,--dmesg}'[Show only kernel messages, Implies -b]' \
-{-u,--unit=}'[Show data only from the specified 
unit]:units:_journal_fields _SYSTEMD_UNIT' \
-'--user-unit[Show data only from the specified user session 
unit]:units:_journal_fields _SYSTEMD_USER_UNIT' \
+\*{-u,--unit=}'[Show data only from the specified 
unit]:units:_journal_fields _SYSTEMD_UNIT' \
+'*--user-unit=[Show data only from the specified user session 
unit]:units:_journal_fields USER_UNIT' \
 {-p,--priority=}'[Show only messages within the specified priority 
range]:priority:_journal_fields PRIORITY' \
 {-c,--cursor=}'[Start showing entries from specified 
cursor]:cursors:_journal_fields __CURSORS' \
 '--after-cursor=[Start showing entries from the location in the journal 
after the cursor]:cursors:_journal_fields __CURSORS' \
-- 
1.8.4.rc0.352.g531e8cb

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel