File tree Expand file tree Collapse file tree 3 files changed +8
-17
lines changed
opt/init-wrapper/pre-init.d Expand file tree Collapse file tree 3 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,11 @@ if [ -n "${DEFAULT_LANG}" ]; then
1313fi
1414
1515if [ -n " ${DEFAULT_TZ} " ]; then
16- echo " ${DEFAULT_TZ} " > /etc/timezone
17- # workaround: see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813226
18- [ -L /etc/localtime ] && rm /etc/localtime
19- dpkg-reconfigure -f noninteractive tzdata 1> /dev/null 2> /dev/null
20- etckeeper commit " set timezone to ${DEFAULT_TZ} " 1> /dev/null 2> /dev/null
16+ if [ -e /usr/share/zoneinfo/${DEFAULT_TZ} ]; then
17+ TZ_FILE=$( readlink -f /usr/share/zoneinfo/${DEFAULT_TZ} )
18+ ln -nsf ${TZ_FILE} /etc/localtime
19+ if etckeeper unclean 1> /dev/null 2> /dev/null; then
20+ etckeeper commit " set timezone to ${DEFAULT_TZ} " 1> /dev/null 2> /dev/null
21+ fi
22+ fi
2123fi
Original file line number Diff line number Diff line change @@ -57,10 +57,7 @@ etckeeper commit "localepurge: purge locales other than en and ja"
5757# #
5858# # configure timezone
5959# #
60- echo " Asia/Tokyo" > /etc/timezone
61- # workaround: see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813226
62- [ -L /etc/localtime ] && rm /etc/localtime
63- dpkg-reconfigure -f noninteractive tzdata
60+ ln -nsf /usr/share/zoneinfo/Asia/Tokyo /usr/localtime
6461etckeeper commit " set timezone"
6562
6663# #
Original file line number Diff line number Diff line change 7171 its ( :content ) { should match /^ja_JP\. UTF-8\s +UTF-8\s */ }
7272 end
7373
74- describe file ( "/etc/timezone" ) do
75- its ( :content ) { should include 'Asia/Tokyo' }
76- end
77-
7874 describe file ( "/etc/localtime" ) do
7975 it { should be_linked_to '/usr/share/zoneinfo/Asia/Tokyo' }
8076 end
223219 its ( :content ) { should include 'LANG=en_US.UTF-8' }
224220 end
225221
226- describe file ( "/etc/timezone" ) do
227- its ( :content ) { should include 'Etc/UTC' }
228- end
229-
230222 describe file ( "/etc/localtime" ) do
231223 it { should be_linked_to '/usr/share/zoneinfo/Etc/UTC' }
232224 end
You can’t perform that action at this time.
0 commit comments