From 6edd7d0a09171ea5ae8e01b7b1cbcb0bdfbfeb16 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 5 May 2012 02:06:58 +0200 Subject: sleep: implement suspend/hibernate as first class targets --- units/.gitignore | 2 ++ units/hibernate.service.in | 16 ++++++++++++++++ units/hibernate.target | 14 ++++++++++++++ units/sleep.target | 13 +++++++++++++ units/suspend.service.in | 16 ++++++++++++++++ units/suspend.target | 14 ++++++++++++++ 6 files changed, 75 insertions(+) create mode 100644 units/hibernate.service.in create mode 100644 units/hibernate.target create mode 100644 units/sleep.target create mode 100644 units/suspend.service.in create mode 100644 units/suspend.target (limited to 'units') diff --git a/units/.gitignore b/units/.gitignore index 68c174f1f5..dc5e1d47d3 100644 --- a/units/.gitignore +++ b/units/.gitignore @@ -1,3 +1,5 @@ +/hibernate.service +/suspend.service /console-getty.service /systemd-journald.service user@.service diff --git a/units/hibernate.service.in b/units/hibernate.service.in new file mode 100644 index 0000000000..6dba653d37 --- /dev/null +++ b/units/hibernate.service.in @@ -0,0 +1,16 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Hibernate +DefaultDependencies=no +Requires=sleep.target +After=sleep.target + +[Service] +Type=oneshot +ExecStart=@rootlibexecdir@/systemd-sleep hibernate diff --git a/units/hibernate.target b/units/hibernate.target new file mode 100644 index 0000000000..05238a7cbf --- /dev/null +++ b/units/hibernate.target @@ -0,0 +1,14 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# See systemd.special(7) for details + +[Unit] +Description=Hibernate +DefaultDependencies=no +BindTo=hibernate.service +After=hibernate.service diff --git a/units/sleep.target b/units/sleep.target new file mode 100644 index 0000000000..9f4b247eb5 --- /dev/null +++ b/units/sleep.target @@ -0,0 +1,13 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# See systemd.special(7) for details + +[Unit] +Description=Sleep +DefaultDependencies=no +RefuseManualStart=yes diff --git a/units/suspend.service.in b/units/suspend.service.in new file mode 100644 index 0000000000..3cf819e476 --- /dev/null +++ b/units/suspend.service.in @@ -0,0 +1,16 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Suspend +DefaultDependencies=no +Requires=sleep.target +After=sleep.target + +[Service] +Type=oneshot +ExecStart=@rootlibexecdir@/systemd-sleep suspend diff --git a/units/suspend.target b/units/suspend.target new file mode 100644 index 0000000000..3ddb44975d --- /dev/null +++ b/units/suspend.target @@ -0,0 +1,14 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# See systemd.special(7) for details + +[Unit] +Description=Suspend +DefaultDependencies=no +BindTo=suspend.service +After=suspend.service -- cgit v1.2.3-54-g00ecf