Skip to content

Commit 41e3db3

Browse files
committed
debian: Package ulimits and sudo rules
The old packages used to write this data to the configuration in a postinst file. That was horrible to track since system administrators had no idea what was going on.
1 parent a6ea691 commit 41e3db3

4 files changed

Lines changed: 57 additions & 4 deletions

File tree

debian/cloudstack-management.install

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,6 +18,8 @@
1818
/etc/cloudstack/server/*
1919
/etc/cloudstack/management/*
2020
/etc/init.d/cloudstack-management
21+
/etc/security/limits.d/cloudstack-limits.conf
22+
/etc/sudoers.d/cloudstack
2123
/var/cache/cloudstack/management
2224
/var/cache/cloudstack/management/work
2325
/var/cache/cloudstack/management/temp

debian/rules

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ build-indep-stamp: configure
3838
-Dcs.replace.properties=replace.properties.tmp
3939
touch $@
4040

41-
clean:
41+
clean:
4242
dh_testdir
4343
dh_testroot
4444
rm -f build-arch-stamp build-indep-stamp configure-stamp
4545
rm -f replace.properties.tmp
46-
dh_clean
46+
dh_clean
4747

4848
install:
4949
dh_testdir
@@ -75,6 +75,8 @@ install:
7575
# cloudstack-management
7676
mkdir $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server
7777
mkdir $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management
78+
mkdir -p $(DESTDIR)/$(SYSCONFDIR)/security/limits.d/
79+
mkdir -p $(DESTDIR)/$(SYSCONFDIR)/sudoers.d/
7880
mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-management
7981
mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-management/webapps/client
8082
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-management/setup
@@ -89,6 +91,12 @@ install:
8991
cp -r client/target/cloud-client-ui-$(VERSION)-SNAPSHOT/* $(DESTDIR)/usr/share/$(PACKAGE)-management/webapps/client/
9092
cp server/target/conf/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server/
9193
cp client/target/conf/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/
94+
95+
# nast hack for a couple of configuration files
96+
mv $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server/cloudstack-limits.conf $(DESTDIR)/$(SYSCONFDIR)/security/limits.d/
97+
mv $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server/cloudstack-sudoers $(DESTDIR)/$(SYSCONFDIR)/sudoers.d/cloudstack
98+
chmod 0440 $(DESTDIR)/$(SYSCONFDIR)/sudoers.d/cloudstack
99+
92100
ln -s tomcat6-nonssl.conf $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/tomcat6.conf
93101
mkdir -p $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/Catalina/localhost/client
94102
install -D packaging/debian/init/cloud-management $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-management
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Specific limits for the CloudStack management server which
19+
# runs under the user 'cloud' by default
20+
@MSUSER hard nofile 4096
21+
@MSUSER soft nofile 4096

server/conf/cloudstack-sudoers.in

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# The CloudStack management server needs sudo permissions
19+
# without a password.
20+
21+
@MSUSER ALL =NOPASSWD : ALL
22+

0 commit comments

Comments
 (0)