- if node[:lsb][:release].to_f >= 16.04
- service "serial-getty@ttyS#{unit}" do
- action [:enable, :start]
- end
- else
- file "/etc/init/ttySttyS#{unit}.conf" do
- action :delete
- end
-
- template "/etc/init/ttyS#{unit}.conf" do
- source "tty.conf.erb"
- owner "root"
- group "root"
- mode 0o644
- variables :unit => unit
- end
-
- service "ttyS#{unit}" do
- provider Chef::Provider::Service::Upstart
- action [:enable, :start]
- supports :status => true, :restart => true, :reload => false
- subscribes :restart, "template[/etc/init/ttyS#{unit}.conf]"
- end
+ service "serial-getty@ttyS#{unit}" do
+ action [:enable, :start]