Solution
1) which is connected using a query, connect to the server to kill the process with shell
select procpid,* from pg_stat_activity where DATNAME='template1';
Connect to the server kill off the process kill -9 13395
Then create you can create a success
2) specify the template when creating a database
create database database database owner user ENCODING 'UTF-8' template = template0;